Package com.google.common.reflect
Class TypeParameter<T>
- java.lang.Object
-
- com.google.common.reflect.TypeParameter<T>
-
public abstract class TypeParameter<T> extends java.lang.Object
Captures a free type variable that can be used inTypeToken.where(com.google.common.reflect.TypeParameter<X>, com.google.common.reflect.TypeToken<X>)
. For example:static <T> TypeToken<List<T>> listOf(Class<T> elementType) { return new TypeToken<List<T>>() {} .where(new TypeParameter<T>() {}, elementType); }
- Since:
- 12.0
- Author:
- Ben Yu
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeParameter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
TypeParameter
protected TypeParameter()
-
-
Method Detail
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(@CheckForNull java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-