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

pkiraly / metadata-qa-api / #670

07 May 2025 11:19AM UTC coverage: 87.237% (-0.004%) from 87.241%
#670

push

pkiraly
Update dependencies and fixing tests

1 of 2 new or added lines in 1 file covered. (50.0%)

1 existing line in 1 file now uncovered.

5523 of 6331 relevant lines covered (87.24%)

0.87 hits per line

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

77.42
/src/main/java/de/gwdg/metadataqa/api/configuration/MeasurementConfiguration.java
1
package de.gwdg.metadataqa.api.configuration;
2

3
import com.fasterxml.jackson.core.JsonProcessingException;
4
import com.fasterxml.jackson.databind.ObjectMapper;
5
import de.gwdg.metadataqa.api.rule.RuleCheckingOutputType;
6
import de.gwdg.metadataqa.api.uniqueness.SolrClient;
7
import de.gwdg.metadataqa.api.uniqueness.SolrConfiguration;
8
import org.apache.commons.lang3.StringUtils;
9

10
import java.io.Serializable;
11
import java.util.LinkedHashMap;
12
import java.util.Map;
13
import java.util.logging.Logger;
14

15
public class MeasurementConfiguration implements Serializable {
16
  private static final long serialVersionUID = 7754969792852694442L;
17
  private static final Logger logger = Logger.getLogger(MeasurementConfiguration.class.getCanonicalName());
1✔
18

19
  /**
20
   * Flag whether or not the field extractor is enabled (default: false).
21
   */
22
  private boolean fieldExtractorEnabled = false;
1✔
23

24
  /**
25
   * Flag whether or not run the field existence measurement
26
   * (default: true).
27
   */
28
  protected boolean fieldExistenceMeasurementEnabled = true;
1✔
29

30
  /**
31
   * Flag whether or not run the field cardinality measurement
32
   * (default: true).
33
   */
34
  protected boolean fieldCardinalityMeasurementEnabled = true;
1✔
35

36
  /**
37
   * Flag whether or not run the completeness measurement
38
   * (default: true).
39
   */
40
  protected boolean completenessMeasurementEnabled = true;
1✔
41

42
  /**
43
   * Flag whether or not run the uniqueness measurement
44
   * (default: false).
45
   */
46
  protected boolean tfIdfMeasurementEnabled = false;
1✔
47

48
  /**
49
   * Flag whether or not run the problem catalog
50
   * (default: false).
51
   */
52
  protected boolean problemCatalogMeasurementEnabled = false;
1✔
53

54
  /**
55
   * Flag whether or not run the rule catalog
56
   * (default: false).
57
   */
58
  protected boolean ruleCatalogMeasurementEnabled = false;
1✔
59

60
  /**
61
   * Flag whether or not run the language detector
62
   * (default: false).
63
   */
64
  protected boolean languageMeasurementEnabled = false;
1✔
65

66
  /**
67
   * Flag whether or not run the multilingual saturation measurement
68
   * (default: false).
69
   */
70
  protected boolean multilingualSaturationMeasurementEnabled = false;
1✔
71

72
  /**
73
   * Flag whether or not collect TF-IDF terms in uniqueness measurement
74
   * (default: false).
75
   */
76
  protected boolean collectTfIdfTerms = false;
1✔
77

78
  /**
79
   * Flag whether or not to run in uniqueness measurement (default: false).
80
   */
81
  protected boolean uniquenessMeasurementEnabled = false;
1✔
82

83
  /**
84
   * Flag whether or not to run in uniqueness measurement (default: false).
85
   */
86
  protected boolean indexingEnabled = false;
1✔
87

88
  /**
89
   * Flag whether or not to run missing/empty/existing field collection in
90
   * completeness (default: false).
91
   */
92
  protected boolean completenessCollectFields = false;
1✔
93

94
  /**
95
   * Flag whether or not to create extended result in multilingual saturation calculation (default: false).
96
   */
97
  protected boolean saturationExtendedResult = false;
1✔
98

99
  /**
100
   * Flag whether or not to check skipable collections (default: false).
101
   */
102
  protected boolean checkSkippableCollections = false;
1✔
103

104
  protected boolean onlyIdInHeader = false;
1✔
105

106
  /**
107
   * Solr host name
108
   */
109
  protected String solrHost;
110

111
  /**
112
   * Solr port
113
   */
114
  protected String solrPort;
115

116
  /**
117
   * Solr URL path
118
   */
119
  protected String solrPath;
120

121
  /**
122
   * A SolrClient
123
   */
124
  protected SolrClient solrClient;
125

126
  private RuleCheckingOutputType ruleCheckingOutputType = RuleCheckingOutputType.SCORE;
1✔
127
  private Map<String, Object> annottaionColumns;
128

129
  private boolean generatedIdentifierEnabled = false;
1✔
130

131
  public MeasurementConfiguration() {}
1✔
132

133
  /**
134
   * Create calculator facade with configuration.
135
   * @param runFieldExistence
136
   *   Flag whether or not run the field existence measurement
137
   * @param runFieldCardinality
138
   *   Flag whether or not run the field cardinality measurement
139
   * @param runCompleteness
140
   *   Flag whether or not run the completeness measurement
141
   * @param runTfIdf
142
   *   Flag whether or not run the uniqueness measurement
143
   * @param runProblemCatalog
144
   *   Flag whether or not run the problem catalog
145
   */
146
  public MeasurementConfiguration(final boolean runFieldExistence,
147
                          final boolean runFieldCardinality,
148
                          final boolean runCompleteness,
149
                          final boolean runTfIdf,
150
                          final boolean runProblemCatalog) {
1✔
151
    this.fieldExistenceMeasurementEnabled = runFieldExistence;
1✔
152
    this.fieldCardinalityMeasurementEnabled = runFieldCardinality;
1✔
153
    this.completenessMeasurementEnabled = runCompleteness;
1✔
154
    this.tfIdfMeasurementEnabled = runTfIdf;
1✔
155
    this.problemCatalogMeasurementEnabled = runProblemCatalog;
1✔
156
  }
1✔
157

158
  public MeasurementConfiguration enableFieldExtractor() {
159
    return enableFieldExtractor(true);
1✔
160
  }
161

162
  public MeasurementConfiguration disableFieldExtractor() {
163
    return enableFieldExtractor(false);
1✔
164
  }
165

166
  public MeasurementConfiguration enableFieldExtractor(boolean flag) {
167
    this.fieldExtractorEnabled = flag;
1✔
168
    return this;
1✔
169
  }
170

171
  public void setFieldExtractorEnabled(boolean fieldExtractorEnabled) {
172
    this.fieldExtractorEnabled = fieldExtractorEnabled;
1✔
173
  }
1✔
174

175
  public boolean isFieldExtractorEnabled() {
176
    return fieldExtractorEnabled;
1✔
177
  }
178

179
  /**
180
   * Returns whether or not to run the field existence measurement.
181
   * @return
182
   *   field existence measurement flag
183
   */
184
  public boolean isFieldExistenceMeasurementEnabled() {
185
    return fieldExistenceMeasurementEnabled;
1✔
186
  }
187

188
  public MeasurementConfiguration enableFieldExistenceMeasurement() {
189
    return enableFieldExistenceMeasurement(true);
1✔
190
  }
191

192
  public MeasurementConfiguration disableFieldExistenceMeasurement() {
193
    return enableFieldExistenceMeasurement(false);
1✔
194
  }
195

196
  public void setFieldExistenceMeasurementEnabled(boolean fieldExistenceMeasurementEnabled) {
197
    this.fieldExistenceMeasurementEnabled = fieldExistenceMeasurementEnabled;
1✔
198
  }
1✔
199

200
  /**
201
   * Sets whether or not to run the field existence measurement.
202
   * @param runFieldExistence
203
   *    field existence measurement flag
204
   * @return the configuration object
205
   */
206
  public MeasurementConfiguration enableFieldExistenceMeasurement(boolean runFieldExistence) {
207
    this.fieldExistenceMeasurementEnabled = runFieldExistence;
1✔
208
    return this;
1✔
209
  }
210

211
  /**
212
   * Returns whether or not to run cardinality measurement.
213
   * @return
214
   *   Flag to run cardinality measurement
215
   */
216
  public boolean isFieldCardinalityMeasurementEnabled() {
217
    return fieldCardinalityMeasurementEnabled;
1✔
218
  }
219

220
  public void setFieldCardinalityMeasurementEnabled(boolean fieldCardinalityMeasurementEnabled) {
221
    this.fieldCardinalityMeasurementEnabled = fieldCardinalityMeasurementEnabled;
1✔
222
  }
1✔
223

224
  public MeasurementConfiguration enableFieldCardinalityMeasurement() {
225
    return enableFieldCardinalityMeasurement(true);
1✔
226
  }
227

228
  public MeasurementConfiguration disableFieldCardinalityMeasurement() {
229
    return enableFieldCardinalityMeasurement(false);
1✔
230
  }
231

232
  /**
233
   * configure to run the cardinality measurement.
234
   * @param runFieldCardinality
235
   *    cardinality measurement flag
236
   * @return the configuration object
237
   */
238
  public MeasurementConfiguration enableFieldCardinalityMeasurement(boolean runFieldCardinality) {
239
    this.fieldCardinalityMeasurementEnabled = runFieldCardinality;
1✔
240
    return this;
1✔
241
  }
242

243
  /**
244
   * Returns the flag whether or not run the completeness measurement.
245
   * @return
246
   *   Flag whether or not run the completeness measurement
247
   */
248
  public boolean isCompletenessMeasurementEnabled() {
249
    return completenessMeasurementEnabled;
1✔
250
  }
251

252
  public void setCompletenessMeasurementEnabled(boolean completenessMeasurementEnabled) {
253
    this.completenessMeasurementEnabled = completenessMeasurementEnabled;
1✔
254
  }
1✔
255

256
  public MeasurementConfiguration enableCompletenessMeasurement() {
257
    return enableCompletenessMeasurement(true);
1✔
258
  }
259

260
  public MeasurementConfiguration disableCompletenessMeasurement() {
261
    return enableCompletenessMeasurement(false);
1✔
262
  }
263

264
  /**
265
   * Sets the flag whether or not run the completeness measurement.
266
   * @param runCompleteness
267
   *    flag whether or not run the completeness measurement
268
   * @return the configuration object
269
   */
270
  public MeasurementConfiguration enableCompletenessMeasurement(boolean runCompleteness) {
271
    this.completenessMeasurementEnabled = runCompleteness;
1✔
272
    return this;
1✔
273
  }
274

275
  /**
276
   * Returns the flag whether or not run the language detector.
277
   *
278
   * @return
279
   *   language detector flag
280
   */
281
  public boolean isLanguageMeasurementEnabled() {
282
    return languageMeasurementEnabled;
1✔
283
  }
284

285
  public void setLanguageMeasurementEnabled(boolean languageMeasurementEnabled) {
286
    this.languageMeasurementEnabled = languageMeasurementEnabled;
1✔
287
  }
1✔
288

289
  public MeasurementConfiguration enableLanguageMeasurement() {
290
    return enableLanguageMeasurement(true);
1✔
291
  }
292

293
  public MeasurementConfiguration disableLanguageMeasurement() {
294
    return enableLanguageMeasurement(false);
1✔
295
  }
296

297
  /**
298
   * Configure whether or not run the language detector.
299
   *
300
   * @param runLanguage
301
   * @return the configuration object
302
   */
303
  public MeasurementConfiguration enableLanguageMeasurement(boolean runLanguage) {
304
    this.languageMeasurementEnabled = runLanguage;
1✔
305
    return this;
1✔
306
  }
307

308
  /**
309
   * Returns the flag whether or not run the language detector.
310
   *
311
   * @return
312
   *   language detector flag
313
   */
314
  public boolean isMultilingualSaturationMeasurementEnabled() {
315
    return multilingualSaturationMeasurementEnabled;
1✔
316
  }
317

318
  public void setMultilingualSaturationMeasurementEnabled(boolean multilingualSaturationMeasurementEnabled) {
319
    this.multilingualSaturationMeasurementEnabled = multilingualSaturationMeasurementEnabled;
1✔
320
  }
1✔
321

322
  public MeasurementConfiguration enableMultilingualSaturationMeasurement() {
323
    return enableMultilingualSaturationMeasurement(true);
1✔
324
  }
325

326
  public MeasurementConfiguration disableMultilingualSaturationMeasurement() {
327
    return enableMultilingualSaturationMeasurement(false);
1✔
328
  }
329

330
  /**
331
   * Configure whether or not run the language detector.
332
   *
333
   * @param runMultilingualSaturation
334
   * @return the configuration object
335
   */
336
  public MeasurementConfiguration enableMultilingualSaturationMeasurement(boolean runMultilingualSaturation) {
337
    this.multilingualSaturationMeasurementEnabled = runMultilingualSaturation;
1✔
338
    return this;
1✔
339
  }
340

341
  /**
342
   * Returns whether or not run the uniqueness measurement.
343
   *
344
   * @return
345
   *   uniqueness measurement flag
346
   */
347
  public boolean isTfIdfMeasurementEnabled() {
348
    return tfIdfMeasurementEnabled;
1✔
349
  }
350

351
  public void setTfIdfMeasurementEnabled(boolean tfIdfMeasurementEnabled) {
352
    this.tfIdfMeasurementEnabled = tfIdfMeasurementEnabled;
1✔
353
  }
1✔
354

355
  public MeasurementConfiguration enableTfIdfMeasurement() {
356
    return enableTfIdfMeasurement(true);
1✔
357
  }
358

359
  public MeasurementConfiguration disableTfIdfMeasurement() {
360
    return enableTfIdfMeasurement(false);
1✔
361
  }
362

363
  /**
364
   * Configure whether or not run the uniqueness measurement.
365
   * @param runTfIdf
366
   *   uniqueness measurement flag
367
   * @return the configuration object
368
   */
369
  public MeasurementConfiguration enableTfIdfMeasurement(boolean runTfIdf) {
370
    this.tfIdfMeasurementEnabled = runTfIdf;
1✔
371
    return this;
1✔
372
  }
373

374
  /**
375
   * Gets flag whether to run the problem catalog measurement.
376
   * @return
377
   *   problem catalog measurement flag
378
   */
379
  public boolean isProblemCatalogMeasurementEnabled() {
380
    return problemCatalogMeasurementEnabled;
1✔
381
  }
382

383
  public void setProblemCatalogMeasurementEnabled(boolean problemCatalogMeasurementEnabled) {
384
    this.problemCatalogMeasurementEnabled = problemCatalogMeasurementEnabled;
1✔
385
  }
1✔
386

387
  public MeasurementConfiguration enableProblemCatalogMeasurement() {
388
    return enableProblemCatalogMeasurement(true);
1✔
389
  }
390

391
  public MeasurementConfiguration disableProblemCatalogMeasurement() {
392
    return enableProblemCatalogMeasurement(false);
1✔
393
  }
394

395
  /**
396
   * Configure to run the problem catalog measurement.
397
   * @param runProblemCatalog
398
   *   problem catalog measurement flag
399
   * @return the configuration object
400
   */
401
  public MeasurementConfiguration enableProblemCatalogMeasurement(boolean runProblemCatalog) {
402
    this.problemCatalogMeasurementEnabled = runProblemCatalog;
1✔
403
    return this;
1✔
404
  }
405

406
  /**
407
   * Gets flag whether to run the rule catalog measurement.
408
   * @return
409
   *   problem catalog measurement flag
410
   */
411
  public boolean isRuleCatalogMeasurementEnabled() {
412
    return ruleCatalogMeasurementEnabled;
1✔
413
  }
414

415
  public void setRuleCatalogMeasurementEnabled(boolean ruleCatalogMeasurementEnabled) {
416
    this.ruleCatalogMeasurementEnabled = ruleCatalogMeasurementEnabled;
1✔
417
  }
1✔
418

419
  public MeasurementConfiguration enableRuleCatalogMeasurement() {
420
    return enableRuleCatalogMeasurement(true);
1✔
421
  }
422

423
  public MeasurementConfiguration disableRuleCatalogMeasurement() {
424
    return enableRuleCatalogMeasurement(false);
1✔
425
  }
426

427
  /**
428
   * Configure to run the problem catalog measurement.
429
   * @param run
430
   *   problem catalog measurement flag
431
   * @return the configuration object
432
   */
433
  public MeasurementConfiguration enableRuleCatalogMeasurement(boolean run) {
434
    this.ruleCatalogMeasurementEnabled = run;
1✔
435
    return this;
1✔
436
  }
437

438
  /**
439
   * Is uniqueness measurement enabled?
440
   * @return uniqueness measurement flag
441
   */
442
  public boolean isUniquenessMeasurementEnabled() {
443
    return uniquenessMeasurementEnabled;
1✔
444
  }
445

446
  public void setUniquenessMeasurementEnabled(boolean uniquenessMeasurementEnabled) {
447
    this.uniquenessMeasurementEnabled = uniquenessMeasurementEnabled;
1✔
448
  }
1✔
449

450
  public MeasurementConfiguration enableUniquenessMeasurement() {
451
    return enableUniquenessMeasurement(true);
1✔
452
  }
453

454
  public MeasurementConfiguration disableUniquenessMeasurement() {
455
    return enableUniquenessMeasurement(false);
1✔
456
  }
457

458
  /**
459
   * Flag to enable uniqueness measurement.
460
   * @param uniquenessMeasurementEnabled The flag
461
   * @return the configuration object
462
   */
463
  public MeasurementConfiguration enableUniquenessMeasurement(boolean uniquenessMeasurementEnabled) {
464
    this.uniquenessMeasurementEnabled = uniquenessMeasurementEnabled;
1✔
465
    return this;
1✔
466
  }
467

468

469
  public boolean isIndexingEnabled() {
470
    return indexingEnabled;
1✔
471
  }
472

473
  public void setIndexingEnabled(boolean indexingEnabled) {
474
    this.indexingEnabled = indexingEnabled;
×
475
  }
×
476

477
  public MeasurementConfiguration enableIndexing() {
478
    return enableIndexing(true);
×
479
  }
480

481
  public MeasurementConfiguration disableIndexing() {
482
    return enableIndexing(false);
×
483
  }
484

485
  /**
486
   * Flag to enable uniqueness measurement.
487
   * @param indexingEnabled The flag
488
   * @return the configuration object
489
   */
490
  public MeasurementConfiguration enableIndexing(boolean indexingEnabled) {
491
    this.indexingEnabled = indexingEnabled;
×
492
    return this;
×
493
  }
494

495
  /**
496
   * Returns the flag whether the measurement should collect each individual
497
   * terms with their Term Ferquency and Invers Document Frequency scores.
498
   *
499
   * @return
500
   *   The TF-IDF collector flag
501
   */
502
  public boolean collectTfIdfTerms() {
503
    return collectTfIdfTerms;
1✔
504
  }
505

506
  public void setCollectTfIdfTerms(boolean collectTfIdfTerms) {
507
    this.collectTfIdfTerms = collectTfIdfTerms;
1✔
508
  }
1✔
509

510
  /**
511
   * Sets the flag whether the measurement should collect each individual
512
   * terms with their Term Ferquency and Invers Document Frequency scores.
513
   *
514
   * @param collectTfIdfTerms
515
   *   The TF-IDF collector flag
516
   * @return the configuration object
517
   */
518
  public MeasurementConfiguration collectTfIdfTerms(boolean collectTfIdfTerms) {
519
    this.collectTfIdfTerms = collectTfIdfTerms;
1✔
520
    return this;
1✔
521
  }
522

523
  /**
524
   * Get the completenessCollectFields flag.
525
   *
526
   * @return
527
   *   completenessCollectFields flag
528
   */
529
  public boolean isCompletenessFieldCollectingEnabled() {
530
    return completenessCollectFields;
1✔
531
  }
532

533
  public void setCompletenessCollectFields(boolean completenessCollectFields) {
534
    this.completenessCollectFields = completenessCollectFields;
1✔
535
  }
1✔
536

537
  /**
538
   * The completeness calculation will collect empty, existent and missing fields.
539
   *
540
   * @param completenessCollectFields
541
   *   The completenessCollectFields flag
542
   * @return the configuration object
543
   */
544
  public MeasurementConfiguration enableCompletenessFieldCollecting(boolean completenessCollectFields) {
545
    this.completenessCollectFields = completenessCollectFields;
1✔
546
    return this;
1✔
547
  }
548

549
  public boolean isSaturationExtendedResult() {
550
    return saturationExtendedResult;
1✔
551
  }
552

553
  public void setSaturationExtendedResult(boolean saturationExtendedResult) {
554
    this.saturationExtendedResult = saturationExtendedResult;
1✔
555
  }
1✔
556

557
  public MeasurementConfiguration enableSaturationExtendedResult(boolean saturationExtendedResult) {
558
    this.saturationExtendedResult = saturationExtendedResult;
1✔
559
    return this;
1✔
560
  }
561

562
  public boolean isCheckSkippableCollections() {
563
    return checkSkippableCollections;
1✔
564
  }
565

566
  public void setCheckSkippableCollections(boolean checkSkippableCollections) {
567
    this.checkSkippableCollections = checkSkippableCollections;
1✔
568
  }
1✔
569

570
  public MeasurementConfiguration enableCheckSkippableCollections(boolean checkSkippableCollections) {
571
    this.checkSkippableCollections = checkSkippableCollections;
1✔
572
    return this;
1✔
573
  }
574

575
  public String getSolrHost() {
576
    return solrHost;
1✔
577
  }
578

579
  public void setSolrHost(String solrHost) {
580
    this.solrHost = solrHost;
×
581
  }
×
582

583
  public MeasurementConfiguration withSolrHost(String solrHost) {
584
    this.solrHost = solrHost;
×
585
    return this;
×
586
  }
587

588
  public String getSolrPort() {
589
    return solrPort;
1✔
590
  }
591

592
  public void setSolrPort(String solrPort) {
593
    this.solrPort = solrPort;
×
594
  }
×
595

596
  public MeasurementConfiguration withSolrPort(String solrPort) {
597
    this.solrPort = solrPort;
×
598
    return this;
×
599
  }
600

601
  public boolean isOnlyIdInHeader() {
602
    return onlyIdInHeader;
1✔
603
  }
604

605
  public void setOnlyIdInHeader(boolean onlyIdInHeader) {
606
    this.onlyIdInHeader = onlyIdInHeader;
×
607
  }
×
608

609
  public MeasurementConfiguration withOnlyIdInHeader(boolean onlyIdInHeader) {
610
    this.onlyIdInHeader = onlyIdInHeader;
×
611
    return this;
×
612
  }
613

614
  public RuleCheckingOutputType getRuleCheckingOutputType() {
615
    return ruleCheckingOutputType;
1✔
616
  }
617

618
  public void setRuleCheckingOutputType(RuleCheckingOutputType ruleCheckingOutputType) {
619
    this.ruleCheckingOutputType = ruleCheckingOutputType;
×
620
  }
×
621

622
  public MeasurementConfiguration withRuleCheckingOutputType(RuleCheckingOutputType ruleCheckingOutputType) {
623
    this.ruleCheckingOutputType = ruleCheckingOutputType;
1✔
624
    return this;
1✔
625
  }
626

627
  public String getSolrPath() {
628
    return solrPath;
1✔
629
  }
630

631
  public void setSolrPath(String solrPath) {
632
    this.solrPath = solrPath;
×
633
  }
×
634

635
  public MeasurementConfiguration withSolrPath(String solrPath) {
636
    this.solrPath = solrPath;
×
637
    return this;
×
638
  }
639

640
  public SolrConfiguration getSolrConfiguration() {
641
    if (StringUtils.isNotBlank(solrHost) && StringUtils.isNotBlank(solrPort) && StringUtils.isNotBlank(solrPath))
×
642
      return new SolrConfiguration(solrHost, solrPort, solrPath);
×
643
    else
644
      return null;
×
645
  }
646

647
  public SolrClient getSolrClient() {
648
    return solrClient;
1✔
649
  }
650

651
  public void setSolrClient(SolrClient solrClient) {
652
    this.solrClient = solrClient;
×
653
  }
×
654

655
  public MeasurementConfiguration withSolrClient(SolrClient solrClient) {
656
    this.solrClient = solrClient;
1✔
657
    return this;
1✔
658
  }
659

660
  public MeasurementConfiguration withSolrConfiguration(String solrHost, String solrPort, String solrPath) {
661
    this.solrHost = solrHost;
1✔
662
    this.solrPort = solrPort;
1✔
663
    this.solrPath = solrPath;
1✔
664
    return this;
1✔
665
  }
666

667
  public void setAnnotationColumns(Map<String, Object> annotationColumns) {
668
    this.annottaionColumns = annotationColumns;
×
669
  }
×
670

671
  public MeasurementConfiguration withAnnotationColumns(Map<String, Object> annotationColumns) {
672
    this.annottaionColumns = annotationColumns;
×
673
    return this;
×
674
  }
675

676
  public void setAnnotationColumns(String jsonString) {
677
    withAnnotationColumns(jsonString);
×
678
  }
×
679

680
  public MeasurementConfiguration withAnnotationColumns(String jsonString) {
681
    ObjectMapper mapper = new ObjectMapper();
1✔
682
    annottaionColumns = new LinkedHashMap<>();
1✔
683
    try {
684
      Map<String, Object> map = mapper.readValue(jsonString, Map.class);
1✔
685
      for (Map.Entry<String, Object> entry : map.entrySet()) {
1✔
686
        Object value = entry.getValue();
1✔
687
        if (value instanceof String || value instanceof Integer || value instanceof Double)
1✔
688
          annottaionColumns.put(entry.getKey(), value);
1✔
689
        else
NEW
690
          logger.severe(String.format("The %s key has a value: %s, of an unhandled type %s", entry.getKey(), value, value.getClass()));
×
691
      }
1✔
UNCOV
692
    } catch (JsonProcessingException e) {
×
693
      e.printStackTrace();
×
694
    }
1✔
695
    return this;
1✔
696
  }
697

698
  public Map<String, Object> getAnnottaionColumns() {
699
    return annottaionColumns;
1✔
700
  }
701

702
  public boolean isGeneratedIdentifierEnabled() {
703
    return generatedIdentifierEnabled;
1✔
704
  }
705

706
  public MeasurementConfiguration enableGeneratedIdentifier(boolean flag) {
707
    this.generatedIdentifierEnabled = flag;
×
708
    return this;
×
709
  }
710

711
  public void setGeneratedIdentifierEnabled(boolean generatedIdentifierEnabled) {
712
    this.generatedIdentifierEnabled = generatedIdentifierEnabled;
×
713
  }
×
714
}
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