• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pkiraly / metadata-qa-marc / #1641

02 May 2026 10:32AM UTC coverage: 90.196% (-0.002%) from 90.198%
#1641

push

pkiraly
Improve the generic id parameter #761

19 of 22 new or added lines in 3 files covered. (86.36%)

1 existing line in 1 file now uncovered.

36744 of 40738 relevant lines covered (90.2%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.01
/src/main/java/de/gwdg/metadataqa/marc/cli/parameters/CommonParameters.java
1
package de.gwdg.metadataqa.marc.cli.parameters;
2

3
import com.fasterxml.jackson.annotation.JsonIgnore;
4
import de.gwdg.metadataqa.api.util.FileUtils;
5
import de.gwdg.metadataqa.marc.cli.utils.IgnorableFields;
6
import de.gwdg.metadataqa.marc.cli.utils.ignorablerecords.RecordFilter;
7
import de.gwdg.metadataqa.marc.cli.utils.ignorablerecords.RecordFilterFactory;
8
import de.gwdg.metadataqa.marc.cli.utils.ignorablerecords.RecordIgnorator;
9
import de.gwdg.metadataqa.marc.cli.utils.ignorablerecords.RecordIgnoratorFactory;
10
import de.gwdg.metadataqa.marc.dao.MarcLeader;
11
import de.gwdg.metadataqa.marc.definition.DataSource;
12
import de.gwdg.metadataqa.marc.definition.MarcFormat;
13
import de.gwdg.metadataqa.marc.definition.MarcVersion;
14
import de.gwdg.metadataqa.marc.definition.bibliographic.SchemaType;
15
import de.gwdg.metadataqa.marc.utils.alephseq.AlephseqLine;
16
import org.apache.commons.cli.CommandLine;
17
import org.apache.commons.cli.CommandLineParser;
18
import org.apache.commons.cli.DefaultParser;
19
import org.apache.commons.cli.Options;
20
import org.apache.commons.cli.ParseException;
21
import org.apache.commons.lang3.StringUtils;
22

23
import java.io.File;
24
import java.io.IOException;
25
import java.io.InputStream;
26
import java.io.Serializable;
27
import java.util.List;
28
import java.util.stream.Collectors;
29

30
public class CommonParameters implements Serializable {
31

32
  private static final long serialVersionUID = -4760615880678251867L;
33

34
  protected String[] args;
35
  public static final String DEFAULT_OUTPUT_DIR = ".";
36
  public static final MarcVersion DEFAULT_MARC_VERSION = MarcVersion.MARC21;
1✔
37

38
  /** MARC version (like 'OCLC' or 'DNB') */
39
  protected MarcVersion marcVersion = DEFAULT_MARC_VERSION;
1✔
40
  /** serialization format (like 'ISO' or 'MARCXML') */
41
  protected MarcFormat marcFormat = MarcFormat.ISO;
1✔
42
  /** data source ('file' or 'stream') */
43
  protected DataSource dataSource = DataSource.FILE;
1✔
44
  protected boolean doHelp; // TODO: add to options
45
  protected boolean doLog = true; // TODO: add to options
1✔
46
  /** limit the number of records to process */
47
  protected int limit = -1;
1✔
48
  /** the first record to process */
49
  protected int offset = -1;
1✔
50
  /** the field used as identifier of the record (content of 001) */
51
  protected List<String> ids = null;
1✔
52
  /** the default record type if the record's type is undetectable */
53
  protected MarcLeader.Type defaultRecordType = MarcLeader.Type.BOOKS;
1✔
54
  /** fix the known issues of Alephseq format */
55
  protected boolean fixAlephseq = false;
1✔
56
  /** fix the known issues of Alma format */
57
  protected boolean fixAlma = false;
1✔
58
  /** fix the known issues of Alma format in KBR records */
59
  protected boolean fixKbr = false;
1✔
60
  /** the source is in Alephseq format */
61
  protected boolean alephseq = false;
1✔
62
  /** the source is in MARCXML format */
63
  protected boolean marcxml = false;
1✔
64
  /** the source is in line separated MARC format */
65
  protected boolean lineSeparated = false;
1✔
66
  /** remove spaces from the end of record IDs */
67
  protected boolean trimId = false;
1✔
68
  private String outputDir = DEFAULT_OUTPUT_DIR;
1✔
69
  /** ignore records from the analysis */
70
  protected String ignorableRecords;
71
  @JsonIgnore
72
  protected RecordIgnorator recordIgnorator;
73
  protected RecordFilter recordFilter;
74
  /** The fields that can be ignored during analyses */
75
  protected IgnorableFields ignorableFields = new IgnorableFields();
1✔
76
  protected InputStream stream = null;
1✔
77
  /** default character encoding */
78
  protected String defaultEncoding = null;
1✔
79

80
  @JsonIgnore
1✔
81
  protected Options options = new Options();
82
  protected static final CommandLineParser parser = new DefaultParser();
1✔
83
  protected CommandLine cmd;
84
  private boolean isOptionSet = false;
1✔
85
  private AlephseqLine.TYPE alephseqLineType;
86
  private String picaIdField = "003@$0";
1✔
87
  private String picaSubfieldSeparator = "$";
1✔
88
  private String picaSchemaFile;
89
  private String picaRecordTypeField = "002@$0";
1✔
90
  private SchemaType schemaType = SchemaType.MARC21;
1✔
91
  private String groupBy;
92
  private String groupListFile;
93
  private String solrForScoresUrl;
94
  private Boolean processRecordsWithoutId = false;
1✔
95
  private Boolean hasId;
96

97
  protected void setOptions() {
98
    if (!isOptionSet) {
1✔
99
      options.addOption("m", "marcVersion", true, "MARC version ('OCLC' or 'DNB')");
1✔
100
      options.addOption("h", "help", false, "display help");
1✔
101
      options.addOption("n", "nolog", false, "do not display log messages");
1✔
102
      options.addOption("l", "limit", true, "limit the number of records to process");
1✔
103
      options.addOption("o", "offset", true, "the first record to process");
1✔
104
      options.addOption("i", "id", true, "the field used as identifier of the record (content of 001)");
1✔
105
      options.addOption("d", "defaultRecordType", true, "the default record type if the record's type is undetectable");
1✔
106
      options.addOption("q", "fixAlephseq", false, "fix the known issues of Alephseq format");
1✔
107
      options.addOption("a", "fixAlma", false, "fix the known issues of Alma format");
1✔
108
      options.addOption("b", "fixKbr", false, "fix the known issues of Alma format");
1✔
109
      options.addOption("p", "alephseq", false, "the source is in Alephseq format");
1✔
110
      options.addOption("x", "marcxml", false, "the source is in MARCXML format");
1✔
111
      options.addOption("y", "lineSeparated", false, "the source is in line separated MARC format");
1✔
112
      options.addOption("t", "outputDir", true, "output directory");
1✔
113
      options.addOption("r", "trimId", false, "remove spaces from the end of record IDs");
1✔
114
      options.addOption("z", "ignorableFields", true, "ignore fields from the analysis");
1✔
115
      options.addOption("v", "ignorableRecords", true, "ignore records from the analysis");
1✔
116
      options.addOption("f", "marcFormat", true, "MARC format (like 'ISO' or 'MARCXML')");
1✔
117
      options.addOption("s", "dataSource", true, "data source (file or stream)");
1✔
118
      options.addOption("g", "defaultEncoding", true, "default character encoding");
1✔
119
      options.addOption("1", "alephseqLineType", true, "Alephseq line type");
1✔
120
      options.addOption("2", "picaIdField", true, "PICA id field");
1✔
121
      options.addOption("u", "picaSubfieldSeparator", true, "PICA subfield separator");
1✔
122
      options.addOption("j", "picaSchemaFile", true, "Avram PICA schema file");
1✔
123
      // For now, I'll be using picaSchemaFile for both PICA and UNIMARC. The option could be renamed later or a separate option could be added
124
      options.addOption("w", "schemaType", true, "metadata schema type ('MARC21', 'UNIMARC', or 'PICA')");
1✔
125
      options.addOption("k", "picaRecordType", true, "picaRecordType");
1✔
126
      options.addOption("c", "allowableRecords", true, "allow records for the analysis");
1✔
127
      options.addOption("e", "groupBy", true, "group the results by the value of this data element (e.g. the ILN of  library)");
1✔
128
      options.addOption("3", "groupListFile", true, "the file which contains a list of ILN codes");
1✔
129
      options.addOption("4", "solrForScoresUrl", true, "the URL of the Solr server used to store scores");
1✔
130
      options.addOption("5", "processRecordsWithoutId", false, "process the record even it does not have an identifier");
1✔
131
      isOptionSet = true;
1✔
132
    }
133
  }
1✔
134

135
  public CommonParameters() {
1✔
136
  }
1✔
137

138
  public CommonParameters(String[] arguments)  throws ParseException {
1✔
139
    cmd = parser.parse(getOptions(), arguments);
1✔
140

141
    readSchemaType();
1✔
142
    readMarcVersion();
1✔
143
    readMarcFormat();
1✔
144
    readDataSource();
1✔
145
    doHelp = cmd.hasOption("help");
1✔
146
    doLog = !cmd.hasOption("nolog");
1✔
147
    readLimit();
1✔
148
    readOffset();
1✔
149
    if (offset > -1 && limit > -1)
1✔
150
      limit += offset;
1✔
151
    readId();
1✔
152
    readDefaultRecordType();
1✔
153
    setAlephseq(cmd.hasOption("alephseq"));
1✔
154
    fixAlephseq = cmd.hasOption("fixAlephseq");
1✔
155
    fixAlma = cmd.hasOption("fixAlma");
1✔
156
    fixKbr = cmd.hasOption("fixKbr");
1✔
157
    setMarcxml(cmd.hasOption("marcxml"));
1✔
158
    lineSeparated = cmd.hasOption("lineSeparated");
1✔
159
    readOutputDir();
1✔
160
    trimId = cmd.hasOption("trimId");
1✔
161
    readIgnorableFields();
1✔
162
    readIgnorableRecords();
1✔
163
    readAllowableRecords();
1✔
164
    readDefaultEncoding();
1✔
165
    readAlephseqLineType();
1✔
166
    readPicaIdField();
1✔
167
    readPicaSubfieldSeparator();
1✔
168
    readPicaSchemaFile();
1✔
169
    readPicaRecordType();
1✔
170
    readGroupBy();
1✔
171
    readGroupListFile();
1✔
172
    readSolrForScoresUrl();
1✔
173
    readProcessRecordsWithoutId();
1✔
174

175
    args = cmd.getArgs();
1✔
176
  }
1✔
177

178
  private void readPicaSchemaFile() {
179
    if (cmd.hasOption("picaSchemaFile"))
1✔
180
      picaSchemaFile = cmd.getOptionValue("picaSchemaFile");
×
181
  }
1✔
182

183
  private void readPicaRecordType() {
184
    if (cmd.hasOption("picaRecordType"))
1✔
185
      picaRecordTypeField = cmd.getOptionValue("picaRecordType");
1✔
186
  }
1✔
187

188
  private void readGroupBy() {
189
    if (cmd.hasOption("groupBy"))
1✔
190
      groupBy = cmd.getOptionValue("groupBy");
1✔
191
  }
1✔
192

193
  private void readGroupListFile() {
194
    if (cmd.hasOption("groupListFile"))
1✔
195
      groupListFile = cmd.getOptionValue("groupListFile");
1✔
196
  }
1✔
197

198
  private void readSolrForScoresUrl() {
199
    if (cmd.hasOption("solrForScoresUrl"))
1✔
200
      solrForScoresUrl = cmd.getOptionValue("solrForScoresUrl");
1✔
201
  }
1✔
202

203
  private void readPicaSubfieldSeparator() {
204
    if (cmd.hasOption("picaSubfieldSeparator"))
1✔
205
      picaSubfieldSeparator = cmd.getOptionValue("picaSubfieldSeparator");
1✔
206
  }
1✔
207

208
  private void readPicaIdField() {
209
    if (cmd.hasOption("picaIdField"))
1✔
210
      picaIdField = cmd.getOptionValue("picaIdField");
1✔
211
  }
1✔
212

213
  private void readAlephseqLineType() throws ParseException {
214
    if (cmd.hasOption("alephseqLineType"))
1✔
215
      setAlephseqLineType(cmd.getOptionValue("alephseqLineType"));
1✔
216
  }
1✔
217

218
  private void readDefaultEncoding() {
219
    if (cmd.hasOption("defaultEncoding"))
1✔
220
      setDefaultEncoding(cmd.getOptionValue("defaultEncoding"));
1✔
221
  }
1✔
222

223
  private void readIgnorableRecords() {
224
    ignorableRecords = cmd.hasOption("ignorableRecords") ? cmd.getOptionValue("ignorableRecords") : "";
1✔
225
    setRecordIgnorator(ignorableRecords);
1✔
226
  }
1✔
227

228
  private void readAllowableRecords() {
229
    String allowableRecords = cmd.hasOption("allowableRecords") ? cmd.getOptionValue("allowableRecords") : "";
1✔
230
    setRecordFilter(allowableRecords);
1✔
231
  }
1✔
232

233
  private void readIgnorableFields() {
234
    if (cmd.hasOption("ignorableFields"))
1✔
235
      setIgnorableFields(cmd.getOptionValue("ignorableFields"));
1✔
236
  }
1✔
237

238
  private void readOutputDir() {
239
    if (cmd.hasOption("outputDir"))
1✔
240
      outputDir = cmd.getOptionValue("outputDir");
1✔
241
  }
1✔
242

243
  private void readDefaultRecordType() throws ParseException {
244
    if (cmd.hasOption("defaultRecordType"))
1✔
245
      setDefaultRecordType(cmd.getOptionValue("defaultRecordType"));
1✔
246
  }
1✔
247

248
  private void readId() {
249
    if (cmd.hasOption("id")) {
1✔
250
      String raWid = cmd.getOptionValue("id").trim();
1✔
251
      if (!raWid.isEmpty()) {
1✔
252
        if (raWid.startsWith("file:")) {
1✔
253
          String fileName = raWid.substring("file:".length());
1✔
254
          try {
255
            ids = FileUtils.readLinesFromFile(fileName);
1✔
NEW
256
          } catch (IOException e) {
×
NEW
257
            throw new RuntimeException(e);
×
258
          }
1✔
259
        } else if (raWid.contains(",")) {
1✔
260
          ids = List.of(raWid.split(","));
1✔
261
        } else {
262
          ids = List.of(raWid);
1✔
263
        }
264
      }
265
    }
266
  }
1✔
267

268
  private void readOffset() {
269
    if (cmd.hasOption("offset"))
1✔
270
      offset = Integer.parseInt(cmd.getOptionValue("offset"));
1✔
271
  }
1✔
272

273
  private void readLimit() {
274
    if (cmd.hasOption("limit"))
1✔
275
      limit = Integer.parseInt(cmd.getOptionValue("limit"));
1✔
276
  }
1✔
277

278
  private void readDataSource() throws ParseException {
279
    if (cmd.hasOption("dataSource"))
1✔
280
      setDataSource(cmd.getOptionValue("dataSource"));
1✔
281
  }
1✔
282

283
  private void readSchemaType() throws ParseException {
284
    if (cmd.hasOption("schemaType"))
1✔
285
      setSchemaType(cmd.getOptionValue("schemaType"));
1✔
286
  }
1✔
287

288
  private void setSchemaType(String input) throws ParseException {
289
    try {
290
      schemaType = SchemaType.valueOf(input);
1✔
291
    } catch (IllegalArgumentException e) {
1✔
292
      throw new ParseException(String.format("Unrecognized schemaType parameter value: '%s'", input));
1✔
293
    }
1✔
294
  }
1✔
295

296
  private void readMarcFormat() throws ParseException {
297
    if (cmd.hasOption("marcFormat"))
1✔
298
      setMarcFormat(cmd.getOptionValue("marcFormat"));
1✔
299
  }
1✔
300

301
  private void readMarcVersion() throws ParseException {
302
    if (cmd.hasOption("marcVersion"))
1✔
303
      setMarcVersion(cmd.getOptionValue("marcVersion"));
1✔
304
  }
1✔
305

306
  private void readProcessRecordsWithoutId() {
307
    if (cmd.hasOption("processRecordsWithoutId"))
1✔
308
      processRecordsWithoutId = true;
×
309
  }
1✔
310

311
  private void setAlephseqLineType(String alephseqLineTypeInput) throws ParseException {
312
    try {
313
      alephseqLineType = AlephseqLine.TYPE.valueOf(cmd.getOptionValue("alephseqLineType"));
1✔
314
    } catch (IllegalArgumentException e) {
1✔
315
      throw new ParseException(String.format("Unrecognized alephseqLineType parameter value: '%s'", alephseqLineTypeInput));
1✔
316
    }
1✔
317
  }
1✔
318

319
  public Options getOptions() {
320
    if (!isOptionSet)
1✔
321
      setOptions();
1✔
322
    return options;
1✔
323
  }
324

325
  public MarcVersion getMarcVersion() {
326
    return marcVersion;
1✔
327
  }
328

329
  public void setMarcVersion(MarcVersion marcVersion) {
330
    this.marcVersion = marcVersion;
×
331
  }
×
332

333
  public void setMarcVersion(String marcVersion) throws ParseException {
334
    this.marcVersion = MarcVersion.byCode(marcVersion.trim());
1✔
335
    if (this.marcVersion == null)
1✔
336
      throw new ParseException(String.format("Unrecognized marcVersion parameter value: '%s'", marcVersion));
1✔
337
  }
1✔
338

339
  public MarcFormat getMarcFormat() {
340
    return marcFormat;
1✔
341
  }
342

343
  public void setMarcFormat(MarcFormat marcFormat) {
344
    this.marcFormat = marcFormat;
×
345
  }
×
346

347
  public void setMarcFormat(String marcFormatString) throws ParseException {
348
    marcFormat = MarcFormat.byCode(marcFormatString.trim());
1✔
349
    if (marcFormat == null)
1✔
350
      throw new ParseException(String.format("Unrecognized marcFormat parameter value: '%s'", marcFormatString));
×
351
    if (marcFormat.equals(MarcFormat.ALEPHSEQ))
1✔
352
      setAlephseq(true);
1✔
353
    if (marcFormat.equals(MarcFormat.XML))
1✔
354
      setMarcxml(true);
×
355
    if (marcFormat.equals(MarcFormat.LINE_SEPARATED))
1✔
356
      setLineSeparated(true);
×
357
    if (marcFormat.equals(MarcFormat.PICA_NORMALIZED) || marcFormat.equals(MarcFormat.PICA_PLAIN))
1✔
358
      schemaType = SchemaType.PICA;
1✔
359
  }
1✔
360

361
  public DataSource getDataSource() {
362
    return dataSource;
1✔
363
  }
364

365
  public void setDataSource(DataSource dataSource) {
366
    this.dataSource = dataSource;
×
367
  }
×
368

369
  public void setDataSource(String dataSourceString) throws ParseException {
370
    dataSource = DataSource.byCode(dataSourceString.trim());
1✔
371
    if (dataSource == null)
1✔
372
      throw new ParseException(String.format("Unrecognized marcFormat parameter value: '%s'", dataSourceString));
1✔
373
  }
1✔
374

375
  public boolean doHelp() {
376
    return doHelp;
1✔
377
  }
378

379
  public void setDoHelp(boolean doHelp) {
380
    this.doHelp = doHelp;
×
381
  }
×
382

383
  public boolean doLog() {
384
    return doLog;
1✔
385
  }
386

387
  public void setDoLog(boolean doLog) {
388
    this.doLog = doLog;
×
389
  }
×
390

391
  public String[] getArgs() {
392
    return args;
1✔
393
  }
394

395
  public int getLimit() {
396
    return limit;
1✔
397
  }
398

399
  public void setLimit(int limit) {
400
    this.limit = limit;
×
401
  }
×
402

403
  public int getOffset() {
404
    return offset;
1✔
405
  }
406

407
  public void setOffset(int offset) {
408
    this.offset = offset;
×
409
  }
×
410

411
  public boolean hasId() {
412
    if (hasId == null)
1✔
413
      hasId = ids != null && !ids.isEmpty() && StringUtils.isNotBlank(ids.get(0));
1✔
414
    return hasId;
1✔
415
  }
416

417
  public List<String> getId() {
418
    return ids;
1✔
419
  }
420

421
  public void setId(List<String> id) {
NEW
422
    this.ids = id;
×
UNCOV
423
  }
×
424

425
  public MarcLeader.Type getDefaultRecordType() {
426
    return defaultRecordType;
1✔
427
  }
428

429
  public void setDefaultRecordType(MarcLeader.Type defaultRecordType) {
430
    this.defaultRecordType = defaultRecordType;
×
431
  }
×
432

433
  public void setDefaultRecordType(String defaultRecordType) throws ParseException {
434
    this.defaultRecordType = MarcLeader.Type.valueOf(defaultRecordType);
1✔
435
    if (this.defaultRecordType == null)
1✔
436
      throw new ParseException(String.format("Unrecognized defaultRecordType parameter value: '%s'", defaultRecordType));
×
437
  }
1✔
438

439
  public boolean fixAlephseq() {
440
    return fixAlephseq;
1✔
441
  }
442

443
  public void setFixAlephseq(boolean fixAlephseq) {
444
    this.fixAlephseq = fixAlephseq;
×
445
  }
×
446

447
  public boolean fixAlma() {
448
    return fixAlma;
1✔
449
  }
450

451
  public void setFixAlma(boolean fixAlma) {
452
    this.fixAlma = fixAlma;
×
453
  }
×
454

455
  public boolean fixKbr() {
456
    return fixKbr;
1✔
457
  }
458

459
  public void setFixKbr(boolean fixKbr) {
460
    this.fixKbr = fixKbr;
×
461
  }
×
462

463
  public String getReplacementInControlFields() {
464
    if (fixAlephseq())
1✔
465
      return "^";
×
466
    else if (fixAlma() || fixKbr())
1✔
467
      return "#";
×
468
    else
469
      return null;
1✔
470
  }
471

472
  public boolean isAlephseq() {
473
    return alephseq;
1✔
474
  }
475

476
  public void setAlephseq(boolean alephseq) {
477
    this.alephseq = alephseq;
1✔
478
    if (alephseq)
1✔
479
      marcFormat = MarcFormat.ALEPHSEQ;
1✔
480
  }
1✔
481

482
  public boolean isMarcxml() {
483
    return marcxml;
1✔
484
  }
485

486
  public void setMarcxml(boolean marcxml) {
487
    this.marcxml = marcxml;
1✔
488
    if (marcxml)
1✔
489
      marcFormat = MarcFormat.XML;
1✔
490
  }
1✔
491

492
  public boolean isLineSeparated() {
493
    return lineSeparated;
1✔
494
  }
495

496
  public void setLineSeparated(boolean lineSeparated) {
497
    this.lineSeparated = lineSeparated;
×
498
  }
×
499

500
  public String getOutputDir() {
501
    return outputDir;
1✔
502
  }
503

504
  public void setOutputDir(String outputDir) {
505
    this.outputDir = outputDir;
×
506
  }
×
507

508
  public boolean getTrimId() {
509
    return trimId;
1✔
510
  }
511

512
  public void setTrimId(boolean trimId) {
513
    this.trimId = trimId;
×
514
  }
×
515

516
  /**
517
   * Returns the ignorable fields
518
   * @see #ignorableFields
519
   * @return the ignorable fields
520
   */
521
  public IgnorableFields getIgnorableFields() {
522
    return ignorableFields;
1✔
523
  }
524

525
  public void setIgnorableFields(String ignorableFields) {
526
    this.ignorableFields.parseFields(ignorableFields.trim());
1✔
527
  }
1✔
528

529
  public RecordIgnorator getRecordIgnorator() {
530
    return recordIgnorator;
1✔
531
  }
532

533
  public void setRecordIgnorator(String ignorableRecords) {
534
    this.recordIgnorator = RecordIgnoratorFactory.create(schemaType, ignorableRecords.trim());
1✔
535
  }
1✔
536

537
  public RecordFilter getRecordFilter() {
538
    return recordFilter;
1✔
539
  }
540

541
  public void setRecordFilter(String allowableRecords) {
542
    this.recordFilter = RecordFilterFactory.create(schemaType, allowableRecords.trim());
1✔
543
  }
1✔
544

545
  public InputStream getStream() {
546
    return stream;
1✔
547
  }
548

549
  public void setStream(InputStream stream) {
550
    this.stream = stream;
×
551
  }
×
552

553
  public String getDefaultEncoding() {
554
    return defaultEncoding;
1✔
555
  }
556

557
  private void setDefaultEncoding(String defaultEncoding) {
558
    this.defaultEncoding = defaultEncoding;
1✔
559
  }
1✔
560

561
  public AlephseqLine.TYPE getAlephseqLineType() {
562
    return this.alephseqLineType;
1✔
563
  }
564

565
  public String getPicaIdField() {
566
    return picaIdField;
1✔
567
  }
568

569
  public void setPicaIdField(String picaIdField) {
570
    this.picaIdField = picaIdField;
×
571
  }
×
572

573
  public String getPicaSubfieldSeparator() {
574
    return picaSubfieldSeparator;
1✔
575
  }
576

577
  public void setPicaSubfieldSeparator(String picaSubfieldSeparator) {
578
    this.picaSubfieldSeparator = picaSubfieldSeparator;
×
579
  }
×
580

581
  public String getPicaSchemaFile() {
582
    return picaSchemaFile;
1✔
583
  }
584

585
  public SchemaType getSchemaType() {
586
    return schemaType;
1✔
587
  }
588

589
  public String getPicaRecordTypeField() {
590
    return picaRecordTypeField;
1✔
591
  }
592

593
  public boolean isMarc21() {
594
    return schemaType.equals(SchemaType.MARC21);
1✔
595
  }
596

597
  public boolean isPica() {
598
    return schemaType.equals(SchemaType.PICA);
1✔
599
  }
600

601
  public boolean isUnimarc() {
602
    return schemaType.equals(SchemaType.UNIMARC);
1✔
603
  }
604

605
  public String getGroupBy() {
606
    return groupBy;
1✔
607
  }
608

609
  public String getGroupListFile() {
610
    return groupListFile;
1✔
611
  }
612

613
  public String getSolrForScoresUrl() {
614
    return solrForScoresUrl;
1✔
615
  }
616

617
  public Boolean getProcessRecordsWithoutId() {
618
    return processRecordsWithoutId;
1✔
619
  }
620

621
  public void setProcessRecordsWithoutId(Boolean processRecordsWithoutId) {
622
    this.processRecordsWithoutId = processRecordsWithoutId;
×
623
  }
×
624

625
  public String formatParameters() {
626
    String text = "";
1✔
627
    text += String.format("schemaType: %s%n", schemaType);
1✔
628
    text += String.format("marcVersion: %s, %s%n", marcVersion.getCode(), marcVersion.getLabel());
1✔
629
    text += String.format("marcFormat: %s, %s%n", marcFormat.getCode(), marcFormat.getLabel());
1✔
630
    text += String.format("dataSource: %s, %s%n", dataSource.getCode(), dataSource.getLabel());
1✔
631
    text += String.format("limit: %d%n", limit);
1✔
632
    text += String.format("offset: %s%n", offset);
1✔
633
    text += String.format("MARC files: %s%n", StringUtils.join(args, ", "));
1✔
634
    text += String.format("id: %s%n", StringUtils.join(ids, ", "));
1✔
635
    text += String.format("defaultRecordType: %s%n", defaultRecordType);
1✔
636
    text += String.format("fixAlephseq: %s%n", fixAlephseq);
1✔
637
    text += String.format("fixAlma: %s%n", fixAlma);
1✔
638
    text += String.format("alephseq: %s%n", alephseq);
1✔
639
    text += String.format("marcxml: %s%n", marcxml);
1✔
640
    text += String.format("lineSeparated: %s%n", lineSeparated);
1✔
641
    text += String.format("outputDir: %s%n", outputDir);
1✔
642
    text += String.format("trimId: %s%n", trimId);
1✔
643
    text += String.format("ignorableFields: %s%n", ignorableFields);
1✔
644
    text += String.format("allowableRecords: %s%n", recordFilter);
1✔
645
    text += String.format("ignorableRecords: %s%n", recordIgnorator);
1✔
646
    text += String.format("defaultEncoding: %s%n", defaultEncoding);
1✔
647
    text += String.format("alephseqLineType: %s%n", alephseqLineType);
1✔
648
    if (isPica()) {
1✔
649
      text += String.format("picaIdField: %s%n", picaIdField);
1✔
650
      text += String.format("picaSubfieldSeparator: %s%n", picaSubfieldSeparator);
1✔
651
      text += String.format("picaRecordType: %s%n", picaRecordTypeField);
1✔
652
    }
653
    text += String.format("groupBy: %s%n", groupBy);
1✔
654
    text += String.format("groupListFile: %s%n", groupListFile);
1✔
655
    text += String.format("solrForScoresUrl: %s%n", solrForScoresUrl);
1✔
656
    text += String.format("processRecordsWithoutId: %s%n", processRecordsWithoutId);
1✔
657

658
    return text;
1✔
659
  }
660
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc