@Test public void convert() { ReferencedCourtCasesTagValueItem valueItem1 = new ReferencedCourtCasesTagValueItem(); valueItem1.setCaseNumber("YYY "); valueItem1.setJudgmentIds(Lists.newArrayList(1234l, 123l)); ReferencedCourtCasesTagValueItem valueItem2 = new ReferencedCourtCasesTagValueItem(); valueItem2.setCaseNumber("SSS"); valueItem2.setJudgmentIds(null); ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems = new ReferencedCourtCasesTagValueItem[] {valueItem1, valueItem2}; List<ReferencedCourtCase> referencedCourtCases = referencedCourtCasesTagValueConverter.convert(referencedCourtCasesTagValueItems); assertEquals(2, referencedCourtCases.size()); assertEquals(valueItem1.getCaseNumber().trim(), referencedCourtCases.get(0).getCaseNumber()); assertEquals(valueItem1.getJudgmentIds(), referencedCourtCases.get(0).getJudgmentIds()); assertTrue(referencedCourtCases.get(0).isGenerated()); assertEquals(valueItem2.getCaseNumber(), referencedCourtCases.get(1).getCaseNumber()); assertEquals(valueItem2.getJudgmentIds(), referencedCourtCases.get(1).getJudgmentIds()); assertTrue(referencedCourtCases.get(1).isGenerated()); }
@Override public List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems) { Preconditions.checkNotNull(referencedCourtCasesTagValueItems); List<ReferencedCourtCase> referencedCourtCases = Lists.newArrayList(); for (ReferencedCourtCasesTagValueItem referencedCourtCaseTagValueItem: referencedCourtCasesTagValueItems) { referencedCourtCases.add(convert(referencedCourtCaseTagValueItem)); } return referencedCourtCases; }
ReferencedCourtCasesTagValueConverter implements EnrichmentTagValueConverter<ReferencedCourtCasesTagValueItem[], List<ReferencedCourtCase>> { @Override public List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems) { Preconditions.checkNotNull(referencedCourtCasesTagValueItems); List<ReferencedCourtCase> referencedCourtCases = Lists.newArrayList(); for (ReferencedCourtCasesTagValueItem referencedCourtCaseTagValueItem: referencedCourtCasesTagValueItems) { referencedCourtCases.add(convert(referencedCourtCaseTagValueItem)); } return referencedCourtCases; } }
ReferencedCourtCasesTagValueConverter implements EnrichmentTagValueConverter<ReferencedCourtCasesTagValueItem[], List<ReferencedCourtCase>> { @Override public List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems) { Preconditions.checkNotNull(referencedCourtCasesTagValueItems); List<ReferencedCourtCase> referencedCourtCases = Lists.newArrayList(); for (ReferencedCourtCasesTagValueItem referencedCourtCaseTagValueItem: referencedCourtCasesTagValueItems) { referencedCourtCases.add(convert(referencedCourtCaseTagValueItem)); } return referencedCourtCases; }  }
ReferencedCourtCasesTagValueConverter implements EnrichmentTagValueConverter<ReferencedCourtCasesTagValueItem[], List<ReferencedCourtCase>> { @Override public List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems) { Preconditions.checkNotNull(referencedCourtCasesTagValueItems); List<ReferencedCourtCase> referencedCourtCases = Lists.newArrayList(); for (ReferencedCourtCasesTagValueItem referencedCourtCaseTagValueItem: referencedCourtCasesTagValueItems) { referencedCourtCases.add(convert(referencedCourtCaseTagValueItem)); } return referencedCourtCases; }  @Override List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems); }
ReferencedCourtCasesTagValueConverter implements EnrichmentTagValueConverter<ReferencedCourtCasesTagValueItem[], List<ReferencedCourtCase>> { @Override public List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems) { Preconditions.checkNotNull(referencedCourtCasesTagValueItems); List<ReferencedCourtCase> referencedCourtCases = Lists.newArrayList(); for (ReferencedCourtCasesTagValueItem referencedCourtCaseTagValueItem: referencedCourtCasesTagValueItems) { referencedCourtCases.add(convert(referencedCourtCaseTagValueItem)); } return referencedCourtCases; }  @Override List<ReferencedCourtCase> convert(ReferencedCourtCasesTagValueItem[] referencedCourtCasesTagValueItems);  }