java.lang.Object
nl.jqno.equalsverifier.internal.prefabvalues.TypeTag

public final class TypeTag extends Object
Represents a generic type, including raw type and generic type parameters.

If the type is not generic, the genericTypes list will be empty.

  • Field Details

    • NULL

      public static final TypeTag NULL
      Null object for TypeTag.
  • Constructor Details

    • TypeTag

      public TypeTag(Class<?> type, TypeTag... genericTypes)
      Constructor.
      Parameters:
      type - The raw type.
      genericTypes - A list of TypeTags for each generic type parameter.
  • Method Details

    • of

      public static TypeTag of(Field field, TypeTag enclosingType)
      Resolves a TypeTag from the type of a Field 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> Class<T> getType()
      Type Parameters:
      T - The returned Class will have this generic type.
      Returns:
      The TypeTag's raw type.
    • getGenericTypes

      public List<TypeTag> getGenericTypes()
      Returns:
      The TypeTag's generic types.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object