Class TypeTag
- java.lang.Object
-
- nl.jqno.equalsverifier.internal.prefabvalues.TypeTag
-
public final class TypeTag extends java.lang.Object
Represents a generic type, including raw type and generic type parameters. If the type is not generic, the genericTypes list will be empty.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.util.List<TypeTag>
getGenericTypes()
<T> java.lang.Class<T>
getType()
int
hashCode()
static TypeTag
of(java.lang.reflect.Field field, TypeTag enclosingType)
Resolves a TypeTag from the type of aField
instance, using an enclosing type to determine any generic parameters the field may contain.java.lang.String
toString()
-
-
-
Field Detail
-
NULL
public static final TypeTag NULL
Null object for TypeTag.
-
-
Constructor Detail
-
TypeTag
public TypeTag(java.lang.Class<?> type, TypeTag... genericTypes)
Constructor.- Parameters:
type
- The raw type.genericTypes
- A list of TypeTags for each generic type parameter.
-
-
Method Detail
-
of
public static TypeTag of(java.lang.reflect.Field field, TypeTag enclosingType)
Resolves a TypeTag from the type of aField
instance, using an enclosing type to determine any generic parameters the field may contain.- Parameters:
field
- The field to resolve.enclosingType
- The type that contains the field, used to determine any generic parameters it may contain.- Returns:
- The TypeTag for the given field.
-
getType
public <T> java.lang.Class<T> getType()
- Type Parameters:
T
- The returnedClass
will have this generic type.- Returns:
- The TypeTag's raw type.
-
getGenericTypes
public java.util.List<TypeTag> getGenericTypes()
- Returns:
- The TypeTag's generic types.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-