I use generics quite widely for working with Java and Guava collections. I understand this well when using the API:
However, it is difficult for me to find generic APIs. Are there design patterns for Java generics? Any links to Java generics can also help. I read:
I am familiar with only two patterns in which generics are useful:
Optional<T>
Predicate<T>
Function<T>
, . . "" , .
, ?
. , , .
Factory . - .
T - .
T
, .
API-, , , , , , extends super, , .
extends
super