@Test(expected=NullPointerException.class) public void convertToJudgmentCorrection_nullJudgment() { String oldJudgmentType = "XXX"; ImportCorrection correctionJudgmentType = createUpdate(null).ofProperty(JUDGMENT_TYPE).oldValue(oldJudgmentType).newValue(judgment.getJudgmentType().name()).build(); correctionConverter.convertToJudgmentCorrection(null, correctionJudgmentType); }
public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); } }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }  }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }  JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection); List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections); }
ImportCorrectionConverter { public JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection) { Preconditions.checkNotNull(importCorrection); Preconditions.checkNotNull(judgment); JudgmentCorrectionBuilder jCorrectionBuilder = JudgmentCorrectionBuilder.createFor(judgment); if (importCorrection.getChangeOperation().equals(ChangeOperation.UPDATE)) { jCorrectionBuilder.update(getCorrectedObject(importCorrection, judgment)); } else if (importCorrection.getChangeOperation().equals(ChangeOperation.CREATE)) { jCorrectionBuilder.create(getCorrectedObject(importCorrection, judgment)); } else { jCorrectionBuilder.delete(importCorrection.getDeletedObjectClass()); } return jCorrectionBuilder.property(importCorrection.getCorrectedProperty()) .oldValue(importCorrection.getOldValue()) .newValue(importCorrection.getNewValue()) .build(); }  JudgmentCorrection convertToJudgmentCorrection(Judgment judgment, ImportCorrection importCorrection); List<JudgmentCorrection> convertToJudgmentCorrections(Judgment judgment, List<ImportCorrection> importCorrections);  }