Module nl.jqno.equalsverifier
Record Class TypeTag
java.lang.Object
java.lang.Record
nl.jqno.equalsverifier.internal.reflection.TypeTag
Represents a generic type, including raw type and generic type parameters.
If the type is not generic, the genericTypes list will be empty.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildLookup(TypeTag enclosingType) final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegenericTypesrecord component.<T> Class<T> getType()Returns the TypeTag's raw type.final inthashCode()Returns a hash code value for this object.static TypeTagResolves a TypeTag from the type of aFieldinstance, using an enclosing type to determine any generic parameters the field may contain.private static TypeTagprocessClass(Class<?> type, List<TypeTag> nestedTags) private static TypeTagprocessGenericArray(GenericArrayType type, Class<?> typeAsClass, TypeTag enclosingType) private static TypeTagprocessParameterizedType(ParameterizedType type, Class<?> typeAsClass, TypeTag enclosingType, List<TypeTag> nestedTags, boolean shortCircuitRecursiveTypeBound) private static TypeTagprocessTypeVariable(TypeVariable<?> type, Class<?> typeAsClass, TypeTag enclosingType, boolean shortCircuitRecursiveTypeBound) private static TypeTagprocessWildcard(WildcardType type, Class<?> typeAsClass, TypeTag enclosingType, boolean shortCircuitRecursiveTypeBound) private static TypeTagresolve(Type type, Class<?> typeAsClass, TypeTag enclosingType, boolean shortCircuitRecursiveTypeBound) toString()Class<?> type()Returns the value of thetyperecord component.
-
Field Details
-
type
The field for thetyperecord component. -
genericTypes
The field for thegenericTypesrecord component. -
NULL
Null object for TypeTag.
-
-
Constructor Details
-
TypeTag
Constructor.- Parameters:
type- The raw type.genericTypes- A list of TypeTags for each generic type parameter.
-
TypeTag
Constructor.- Parameters:
type- The raw type.genericTypes- A list of TypeTags for each generic type parameter.
-
-
Method Details
-
of
Resolves a TypeTag from the type of aFieldinstance, 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.
-
resolve
-
processClass
-
processParameterizedType
-
processGenericArray
private static TypeTag processGenericArray(GenericArrayType type, Class<?> typeAsClass, TypeTag enclosingType) -
processWildcard
private static TypeTag processWildcard(WildcardType type, Class<?> typeAsClass, TypeTag enclosingType, boolean shortCircuitRecursiveTypeBound) -
processTypeVariable
private static TypeTag processTypeVariable(TypeVariable<?> type, Class<?> typeAsClass, TypeTag enclosingType, boolean shortCircuitRecursiveTypeBound) -
buildLookup
-
getType
Returns the TypeTag's raw type.- Type Parameters:
T- The returnedClasswill have this generic type.- Returns:
- The TypeTag's raw type.
-
toString
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
genericTypes
Returns the value of thegenericTypesrecord component.- Returns:
- the value of the
genericTypesrecord component
-