Constructs a new type token of T. Clients create an empty anonymous subclass. Doing so embeds the type parameter in the anonymous class's type hierarchy so we can reconstitute it at runtime despite erasure. For example: {@code TypeToken > t = new TypeToken<List<
()
| 117 | |
| 118 | |
| 119 | protected TypeToken() { |
| 120 | this.runtimeType = capture(); |
| 121 | checkState(!(runtimeType instanceof TypeVariable), |
| 122 | "Cannot construct a TypeToken for a type variable.\n" |
| 123 | + "You probably meant to call new TypeToken<%s>(getClass()) " + "that can resolve the type variable for you.\n" + "If you do need to create a TypeToken of a type variable, " + "please use TypeToken.of() instead.", runtimeType); |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Constructs a new type token of {@code T} while resolving free type variables in the context of |
nothing calls this directly
no test coverage detected