@Test public void g2AlbumToAlbum() throws IOException, JSONException { G2Album g2Album = new G2Album(); g2Album.setId(1024); g2Album.setTitle("Title"); g2Album.setName(12); g2Album.setSummary("Summary"); g2Album.setParentName(1); g2Album.setExtrafields("extrafields"); Album album = G2ConvertUtils.g2AlbumToAlbum(g2Album); Album expectedAlbum = new Album(); expectedAlbum.setId(1024); expectedAlbum.setTitle("Title"); expectedAlbum.setName(12); expectedAlbum.setSummary("Summary"); expectedAlbum.setParentName(1); expectedAlbum.setExtrafields("extrafields"); Assert.assertEquals(expectedAlbum, album); }
public static Album g2AlbumToAlbum(G2Album g2Album) { if(g2Album==null){ return null; } Album album = new Album(); album.setId(g2Album.getId()); album.setName(g2Album.getName()); album.setTitle(g2Album.getTitle()); album.setSummary(g2Album.getSummary()); album.setParentName(g2Album.getParentName()); return album; }
G2ConvertUtils { public static Album g2AlbumToAlbum(G2Album g2Album) { if(g2Album==null){ return null; } Album album = new Album(); album.setId(g2Album.getId()); album.setName(g2Album.getName()); album.setTitle(g2Album.getTitle()); album.setSummary(g2Album.getSummary()); album.setParentName(g2Album.getParentName()); return album; } }
G2ConvertUtils { public static Album g2AlbumToAlbum(G2Album g2Album) { if(g2Album==null){ return null; } Album album = new Album(); album.setId(g2Album.getId()); album.setName(g2Album.getName()); album.setTitle(g2Album.getTitle()); album.setSummary(g2Album.getSummary()); album.setParentName(g2Album.getParentName()); return album; }  }
G2ConvertUtils { public static Album g2AlbumToAlbum(G2Album g2Album) { if(g2Album==null){ return null; } Album album = new Album(); album.setId(g2Album.getId()); album.setName(g2Album.getName()); album.setTitle(g2Album.getTitle()); album.setSummary(g2Album.getSummary()); album.setParentName(g2Album.getParentName()); return album; }  static Album g2AlbumToAlbum(G2Album g2Album); static Picture g2PictureToPicture(G2Picture g2Picture, String galleryUrl); static String getBaseUrl(String galleryUrl); static boolean isEmbeddedGallery(String url); }
G2ConvertUtils { public static Album g2AlbumToAlbum(G2Album g2Album) { if(g2Album==null){ return null; } Album album = new Album(); album.setId(g2Album.getId()); album.setName(g2Album.getName()); album.setTitle(g2Album.getTitle()); album.setSummary(g2Album.getSummary()); album.setParentName(g2Album.getParentName()); return album; }  static Album g2AlbumToAlbum(G2Album g2Album); static Picture g2PictureToPicture(G2Picture g2Picture, String galleryUrl); static String getBaseUrl(String galleryUrl); static boolean isEmbeddedGallery(String url);  }