@Test public void jiwigoCategoryToAlbum() { Category jiwigoCategory = new Category(); jiwigoCategory.setIdentifier(43); jiwigoCategory.setName("MyAlbum"); jiwigoCategory.setDirectParent(1); Album album = JiwigoConvertUtils.jiwigoCategoryToAlbum(jiwigoCategory); Album expectedAlbum = new Album(); expectedAlbum.setId(43); expectedAlbum.setName(43); expectedAlbum.setTitle("MyAlbum"); expectedAlbum.setParentName(1); Assert.assertEquals(expectedAlbum, album); }
public static Album jiwigoCategoryToAlbum(Category jiwigoCategory) { if(jiwigoCategory==null){ return null; } Album album = new Album(); album.setId(jiwigoCategory.getIdentifier()); album.setName(jiwigoCategory.getIdentifier()); album.setTitle(jiwigoCategory.getName()); album.setParentName(jiwigoCategory.getDirectParent()==null?0:jiwigoCategory.getDirectParent()); return album; }
JiwigoConvertUtils { public static Album jiwigoCategoryToAlbum(Category jiwigoCategory) { if(jiwigoCategory==null){ return null; } Album album = new Album(); album.setId(jiwigoCategory.getIdentifier()); album.setName(jiwigoCategory.getIdentifier()); album.setTitle(jiwigoCategory.getName()); album.setParentName(jiwigoCategory.getDirectParent()==null?0:jiwigoCategory.getDirectParent()); return album; } }
JiwigoConvertUtils { public static Album jiwigoCategoryToAlbum(Category jiwigoCategory) { if(jiwigoCategory==null){ return null; } Album album = new Album(); album.setId(jiwigoCategory.getIdentifier()); album.setName(jiwigoCategory.getIdentifier()); album.setTitle(jiwigoCategory.getName()); album.setParentName(jiwigoCategory.getDirectParent()==null?0:jiwigoCategory.getDirectParent()); return album; }  }
JiwigoConvertUtils { public static Album jiwigoCategoryToAlbum(Category jiwigoCategory) { if(jiwigoCategory==null){ return null; } Album album = new Album(); album.setId(jiwigoCategory.getIdentifier()); album.setName(jiwigoCategory.getIdentifier()); album.setTitle(jiwigoCategory.getName()); album.setParentName(jiwigoCategory.getDirectParent()==null?0:jiwigoCategory.getDirectParent()); return album; }  static Album jiwigoCategoryToAlbum(Category jiwigoCategory); static Picture jiwigoImageToPicture(Image jiwigoImage); static Album categoriesToAlbum(List<Category> categories); }
JiwigoConvertUtils { public static Album jiwigoCategoryToAlbum(Category jiwigoCategory) { if(jiwigoCategory==null){ return null; } Album album = new Album(); album.setId(jiwigoCategory.getIdentifier()); album.setName(jiwigoCategory.getIdentifier()); album.setTitle(jiwigoCategory.getName()); album.setParentName(jiwigoCategory.getDirectParent()==null?0:jiwigoCategory.getDirectParent()); return album; }  static Album jiwigoCategoryToAlbum(Category jiwigoCategory); static Picture jiwigoImageToPicture(Image jiwigoImage); static Album categoriesToAlbum(List<Category> categories);  }