I am trying to create the following class:
public class FooService { private Client client; public Foo get(Long id) { return client.get(id, Foo.class); } public List<Foo> query() { return Arrays.asList(client.get(Foo[].class)); } }
Everything is fine except Foo[].class :
public abstract class BaseService<T, I> { private Client client; private Class<T> type; public BaseService(Class<T> type) { this.type = type; } public T get(I id) { return client.get(id, type); } public List<T> query() { return Arrays.asList(client.get()); }
How can I solve this problem without passing Foo[].class in the constructor, as I did with Foo.class ?
source share