@@ -7,35 +7,35 @@ public interface Resource<T> {
77
88 void map (T source , Context context );
99
10- static <T > Resource <T > make (Class <? extends Resource < T > > type , T source ) {
10+ static <T , R extends Resource <T >> R make (Class <R > type , T source ) {
1111 return make (type , new Context (), source );
1212 }
1313
14- static <T > List < Resource <T >> make (Class <? extends Resource < T > > type , List <T > source ) {
14+ static <T , R extends Resource <T >> List < R > make (Class <R > type , List <T > source ) {
1515 return make (type , new Context (), source );
1616 }
1717
18- static <T > List < Resource <T >> make (Class <? extends Resource < T > > type , T ... source ) {
18+ static <T , R extends Resource <T >> List < R > make (Class <R > type , T ... source ) {
1919 return make (type , new Context (), source );
2020 }
2121
22- static <T > Resource <T > make (Class <? extends Resource < T > > type , Context context , T source ) {
22+ static <T , R extends Resource <T >> R make (Class <R > type , Context context , T source ) {
2323 if (source == null )
2424 return null ;
2525 try {
26- Resource < T > resource = type .newInstance ();
26+ R resource = type .newInstance ();
2727 resource .map (source , context );
2828 return resource ;
2929 } catch (InstantiationException | IllegalAccessException e ) {
3030 return null ;
3131 }
3232 }
3333
34- static <T > List < Resource <T >> make (Class <? extends Resource < T > > type , Context context , List <T > source ) {
34+ static <T , R extends Resource <T >> List < R > make (Class <R > type , Context context , List <T > source ) {
3535 return source .stream ().map (s -> make (type , context , s )).filter (Objects ::nonNull ).collect (Collectors .toList ());
3636 }
3737
38- static <T > List < Resource <T >> make (Class <? extends Resource < T > > type , Context context , T ... source ) {
38+ static <T , R extends Resource <T >> List < R > make (Class <R > type , Context context , T ... source ) {
3939 return make (type , context , Arrays .asList (source ));
4040 }
4141
0 commit comments