@Test public void audubonTest() { String expected = "{\"id\": \"id\", \"created\": null, \"audubonItems\": [{\"creator\": \"Jose Padial\", " + "\"creatorUri\": null, \"providerLiteral\": \"CM\", \"provider\": null, \"metadataCreatorLiteral\": null, " + "\"metadataCreator\": null, \"metadataProviderLiteral\": null, \"metadataProvider\": null, \"rights\": " + "\"http: + "\"rightsUri\": \"http: + "\"Carnegie Museum of Natural History Herps Collection (CM:Herps)\", \"usageTerms\": " + "\"CC0 1.0 (Public-domain)\", \"webStatement\": null, \"licenseLogoUrl\": null, \"credit\": null, " + "\"attributionLogoUrl\": null, \"attributionLinkUrl\": null, \"fundingAttribution\": null, \"source\": null, " + "\"sourceUri\": null, \"description\": \"Photo taken in 2013\", \"caption\": null, \"language\": null, " + "\"languageUri\": null, \"physicalSetting\": null, \"cvTerm\": null, \"subjectCategoryVocabulary\": null, " + "\"tag\": null, \"locationShown\": null, \"worldRegion\": null, \"countryCode\": null, \"countryName\": null, " + "\"provinceState\": null, \"city\": null, \"sublocation\": null, \"identifier\": \"1b384fd8-8559-42ba-980f-22661a4b5f75\", " + "\"type\": \"StillImage\", \"typeUri\": null, \"subtypeLiteral\": \"Photograph\", \"subtype\": null, \"title\": " + "\"AMBYSTOMA MACULATUM\", \"modified\": \"2017-08-15\", \"metadataDate\": null, \"metadataLanguageLiteral\": null, " + "\"metadataLanguage\": null, \"providerManagedId\": null, \"rating\": null, \"commenterLiteral\": null, " + "\"commenter\": null, \"comments\": null, \"reviewerLiteral\": null, \"reviewer\": null, \"reviewerComments\": null, " + "\"available\": null, \"hasServiceAccessPoint\": null, \"idOfContainingCollection\": null, \"relatedResourceId\": null, " + "\"providerId\": null, \"derivedFrom\": null, \"associatedSpecimenReference\": \"urn:catalog:CM:Herps:156879\", " + "\"associatedObservationReference\": null, \"locationCreated\": null, \"digitizationDate\": null, \"captureDevice\": null, " + "\"resourceCreationTechnique\": null, \"accessUri\": \"https: + "\"format\": \"image/jpeg\", \"formatUri\": null, \"variantLiteral\": null, \"variant\": null, \"variantDescription\": null, " + "\"furtherInformationUrl\": null, \"licensingException\": null, \"serviceExpectation\": \"online\", \"hashFunction\": null, " + "\"hashValue\": null, \"PixelXDimension\": null, \"PixelYDimension\": null, \"taxonCoverage\": null, \"scientificName\": null, " + "\"identificationQualifier\": null, \"vernacularName\": null, \"nameAccordingTo\": null, \"scientificNameId\": null, " + "\"otherScientificName\": null, \"identifiedBy\": null, \"dateIdentified\": null, \"taxonCount\": null, \"subjectPart\": null, " + "\"sex\": null, \"lifeStage\": null, \"subjectOrientation\": null, \"preparations\": null, \"temporal\": null, " + "\"createDate\": \"2010-12-10\", \"timeOfDay\": null}], \"issues\": {\"issueList\": []}}"; Map<String, List<Map<String, String>>> ext = new HashMap<>(1); Map<String, String> audubon = new HashMap<>(16); audubon.put("http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put( "http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put("http: audubon.put( "http: "https: audubon.put( "http: "Carnegie Museum of Natural History Herps Collection (CM:Herps)"); audubon.put("http: ext.put("http: ExtendedRecord er = ExtendedRecord.newBuilder().setId("id").setExtensions(ext).build(); AudubonRecord ar = AudubonRecord.newBuilder().setId("id").build(); AudubonInterpreter.builder().create().interpret(er, ar); Assert.assertEquals(expected, ar.toString()); }
public void interpret(ExtendedRecord er, AudubonRecord ar) { Objects.requireNonNull(er); Objects.requireNonNull(ar); Result<Audubon> result = handler.convert(er); ar.setAudubonItems(result.getList()); ar.getIssues().setIssueList(result.getIssuesAsList()); }
AudubonInterpreter { public void interpret(ExtendedRecord er, AudubonRecord ar) { Objects.requireNonNull(er); Objects.requireNonNull(ar); Result<Audubon> result = handler.convert(er); ar.setAudubonItems(result.getList()); ar.getIssues().setIssueList(result.getIssuesAsList()); } }
AudubonInterpreter { public void interpret(ExtendedRecord er, AudubonRecord ar) { Objects.requireNonNull(er); Objects.requireNonNull(ar); Result<Audubon> result = handler.convert(er); ar.setAudubonItems(result.getList()); ar.getIssues().setIssueList(result.getIssuesAsList()); } @Builder(buildMethodName = "create") private  AudubonInterpreter(
      List<DateComponentOrdering> orderings,
      SerializableFunction<String, String> preprocessDateFn); }
AudubonInterpreter { public void interpret(ExtendedRecord er, AudubonRecord ar) { Objects.requireNonNull(er); Objects.requireNonNull(ar); Result<Audubon> result = handler.convert(er); ar.setAudubonItems(result.getList()); ar.getIssues().setIssueList(result.getIssuesAsList()); } @Builder(buildMethodName = "create") private  AudubonInterpreter(
      List<DateComponentOrdering> orderings,
      SerializableFunction<String, String> preprocessDateFn); void interpret(ExtendedRecord er, AudubonRecord ar); }
AudubonInterpreter { public void interpret(ExtendedRecord er, AudubonRecord ar) { Objects.requireNonNull(er); Objects.requireNonNull(ar); Result<Audubon> result = handler.convert(er); ar.setAudubonItems(result.getList()); ar.getIssues().setIssueList(result.getIssuesAsList()); } @Builder(buildMethodName = "create") private  AudubonInterpreter(
      List<DateComponentOrdering> orderings,
      SerializableFunction<String, String> preprocessDateFn); void interpret(ExtendedRecord er, AudubonRecord ar);  }