Skip to content

Instantly share code, notes, and snippets.

@keating
Created June 1, 2012 08:14
Show Gist options
  • Save keating/2850222 to your computer and use it in GitHub Desktop.
Save keating/2850222 to your computer and use it in GitHub Desktop.
build dto for a list (for MayFramework@BYHT)
import java.util.ArrayList;
import java.util.List;
import com.beiyanght.utils.dto.DtoException;
import com.beiyanght.utils.dto.DtoHelper;
/**
*
* @author keating_andy_given
*/
public class DtoHelp {
public static <T,O> List<T> buildDto(Class<T> t, List<O> list)
throws DtoException {
List<T> dtos = new ArrayList<T>();
for (Object obj : list) {
dtos.add(DtoHelper.build(t, obj));
}
return dtos;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment