2
public abstract class AbstractRESTClientService<E extends IDable<String>>
implements GenericService<E, String> {
private Class<E> classType;
private Class<E[]> classArray;
private String controllerPath;
public AbstractRESTClientService(final Class<E> classType,
final Class<E[]> classArray,
final String controllerPath) {
this.classType = classType;
this.classArray = classArray;
this.controllerPath = controllerPath;
this.webService = new GenericWebClientService<E>();
}
// ... other methods
}
有沒有一種方法來操縱classType所成classArray這樣我不需要classArray以作爲參數傳遞?嫺熟類<E>成Class <E[]>
在理論上,你可以做'類 arrClazz =(類))Array.newInstance(clazz中,0).getClass();',但我不知道是不是最好的方法 –
user902383