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

pkiraly / metadata-qa-marc / #1527

22 Aug 2025 02:21PM UTC coverage: 90.345%. Remained the same
#1527

push

pkiraly
Improve timeline handling

5191 of 6416 new or added lines in 219 files covered. (80.91%)

886 existing lines in 78 files now uncovered.

36717 of 40641 relevant lines covered (90.34%)

0.9 hits per line

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

95.45
/src/main/java/de/gwdg/metadataqa/marc/cli/parameters/MappingParameters.java
1
package de.gwdg.metadataqa.marc.cli.parameters;
2

3
import de.gwdg.metadataqa.marc.model.SolrFieldType;
4
import org.apache.commons.cli.CommandLine;
5
import org.apache.commons.cli.CommandLineParser;
6
import org.apache.commons.cli.DefaultParser;
7
import org.apache.commons.cli.Options;
8
import org.apache.commons.cli.ParseException;
9

10
public class MappingParameters {
11

12
  private boolean exportSubfieldCodes = false;
1✔
13
  private boolean exportSelfDescriptiveCodes = false;
1✔
14
  private boolean exportFrbrFunctions = false;
1✔
15
  private boolean exportCompilanceLevel = false;
1✔
16
  private boolean withLocallyDefinedFields = false;
1✔
17

18
  private SolrFieldType solrFieldType = SolrFieldType.MARC;
1✔
19

20
  protected Options options = new Options();
1✔
21
  protected static final CommandLineParser parser = new DefaultParser();
1✔
22
  protected CommandLine cmd;
23
  private boolean isOptionSet = false;
1✔
24

25
  protected void setOptions() {
26
    if (!isOptionSet) {
1✔
27
      options.addOption("c", "withSubfieldCodelists", false, "with subfield codelists");
1✔
28
      options.addOption("s", "withSelfDescriptiveCode", false, "with self-descriptive codes");
1✔
29
      options.addOption("t", "solrFieldType", true,
1✔
30
        "type of Solr fields, could be one of 'marc-tags', 'human-readable', or 'mixed'");
31
      options.addOption("f", "withFrbrFunctions", false, "with FRBR functions");
1✔
32
      options.addOption("l", "withComplianceLevel", false, "with compilance levels (national, minimal)");
1✔
33
      options.addOption("d", "withLocallyDefinedFields", false, "with locally defined fields");
1✔
34
      isOptionSet = true;
1✔
35
    }
36
  }
1✔
37

38
  public MappingParameters() {
NEW
39
    super();
×
UNCOV
40
  }
×
41

42
  public MappingParameters(String[] arguments) throws ParseException {
1✔
43
    cmd = parser.parse(getOptions(), arguments);
1✔
44

45
    if (cmd.hasOption("withSubfieldCodelists"))
1✔
46
      exportSubfieldCodes = true;
1✔
47

48
    if (cmd.hasOption("withSelfDescriptiveCode"))
1✔
49
      exportSelfDescriptiveCodes = true;
1✔
50

51
    if (cmd.hasOption("solrFieldType"))
1✔
52
      solrFieldType = SolrFieldType.byCode(cmd.getOptionValue("solrFieldType"));
1✔
53

54
    if (cmd.hasOption("withFrbrFunctions"))
1✔
55
      exportFrbrFunctions = true;
1✔
56

57
    if (cmd.hasOption("withComplianceLevel"))
1✔
58
      exportCompilanceLevel = true;
1✔
59

60
    if (cmd.hasOption("withLocallyDefinedFields"))
1✔
61
      withLocallyDefinedFields = true;
1✔
62
  }
1✔
63

64
  public Options getOptions() {
65
    if (!isOptionSet)
1✔
66
      setOptions();
1✔
67
    return options;
1✔
68
  }
69

70
  public boolean doExportSubfieldCodes() {
71
    return exportSubfieldCodes;
1✔
72
  }
73

74
  public boolean doExportSelfDescriptiveCodes() {
75
    return exportSelfDescriptiveCodes;
1✔
76
  }
77

78
  public SolrFieldType getSolrFieldType() {
79
    return solrFieldType;
1✔
80
  }
81

82
  public boolean doExportFrbrFunctions() {
83
    return exportFrbrFunctions;
1✔
84
  }
85

86
  public boolean doExportCompilanceLevel() {
87
    return exportCompilanceLevel;
1✔
88
  }
89

90
  public boolean isWithLocallyDefinedFields() {
91
    return withLocallyDefinedFields;
1✔
92
  }
93
}
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