@Test public void testMappings() { OtherNames otherNames = createOtherNames(); List<OtherName> result = converter.convert(otherNames); Assert.assertEquals("Should map 6 othernames", 6, result.size()); Iterator<OtherName> resIt = result.iterator(); for (String sliNameType : nameTypeMap.values()) { OtherName sliName = resIt.next(); Assert.assertNotNull(sliName); Assert.assertEquals(sliNameType, sliName.getOtherNameType()); Assert.assertEquals(firstName, sliName.getFirstName()); Assert.assertEquals(lastName, sliName.getLastSurname()); Assert.assertEquals(middleName, sliName.getMiddleName()); Assert.assertEquals(suffix, sliName.getGenerationCodeSuffix()); Assert.assertEquals(prefix, sliName.getPersonalTitlePrefix()); } }
public List<OtherName> convert(OtherNames sifOtherNames) { if (sifOtherNames == null) { return null; } List<OtherName> sliNames = new ArrayList<OtherName>(); for (openadk.library.common.Name sifName : sifOtherNames) { OtherName sliName = new OtherName(); nameConverter.mapSifNameIntoSliName(sifName, sliName); sliName.setOtherNameType(NAME_TYPE_MAP.get(sifName.getType())); sliNames.add(sliName); } return sliNames; }
OtherNamesConverter { public List<OtherName> convert(OtherNames sifOtherNames) { if (sifOtherNames == null) { return null; } List<OtherName> sliNames = new ArrayList<OtherName>(); for (openadk.library.common.Name sifName : sifOtherNames) { OtherName sliName = new OtherName(); nameConverter.mapSifNameIntoSliName(sifName, sliName); sliName.setOtherNameType(NAME_TYPE_MAP.get(sifName.getType())); sliNames.add(sliName); } return sliNames; } }
OtherNamesConverter { public List<OtherName> convert(OtherNames sifOtherNames) { if (sifOtherNames == null) { return null; } List<OtherName> sliNames = new ArrayList<OtherName>(); for (openadk.library.common.Name sifName : sifOtherNames) { OtherName sliName = new OtherName(); nameConverter.mapSifNameIntoSliName(sifName, sliName); sliName.setOtherNameType(NAME_TYPE_MAP.get(sifName.getType())); sliNames.add(sliName); } return sliNames; }  }
OtherNamesConverter { public List<OtherName> convert(OtherNames sifOtherNames) { if (sifOtherNames == null) { return null; } List<OtherName> sliNames = new ArrayList<OtherName>(); for (openadk.library.common.Name sifName : sifOtherNames) { OtherName sliName = new OtherName(); nameConverter.mapSifNameIntoSliName(sifName, sliName); sliName.setOtherNameType(NAME_TYPE_MAP.get(sifName.getType())); sliNames.add(sliName); } return sliNames; }  List<OtherName> convert(OtherNames sifOtherNames); void setNameConverter(NameConverter nameConverter); }
OtherNamesConverter { public List<OtherName> convert(OtherNames sifOtherNames) { if (sifOtherNames == null) { return null; } List<OtherName> sliNames = new ArrayList<OtherName>(); for (openadk.library.common.Name sifName : sifOtherNames) { OtherName sliName = new OtherName(); nameConverter.mapSifNameIntoSliName(sifName, sliName); sliName.setOtherNameType(NAME_TYPE_MAP.get(sifName.getType())); sliNames.add(sliName); } return sliNames; }  List<OtherName> convert(OtherNames sifOtherNames); void setNameConverter(NameConverter nameConverter);  }