Class JaversType

java.lang.Object
org.javers.core.metamodel.type.JaversType
Direct Known Subclasses:
CustomType, EnumerableType, IgnoredType, ManagedType, PrimitiveOrValueType, TokenType

public abstract class JaversType extends Object
Managed property type

This is the convenient abstraction layer awkward java.lang.reflect.Type and java.lang.Class
  • Field Details

    • DEFAULT_TYPE_PARAMETER

      public static final Class DEFAULT_TYPE_PARAMETER
  • Method Details

    • spawnConstructorArgs

      protected Object[] spawnConstructorArgs(Type baseJavaType)
    • spawnConstructorArgTypes

      protected Class[] spawnConstructorArgTypes()
    • isGenericType

      public boolean isGenericType()
    • getBaseJavaType

      public Type getBaseJavaType()
    • getName

      public String getName()
      JaversType name, clientsClass.name by default or value of TypeName annotation.
    • isInstance

      public abstract boolean isInstance(Object cdo)
    • canBePrototype

      public abstract boolean canBePrototype()
    • equals

      public boolean equals(Object left, Object right)
      Used for comparing as Values
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

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

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

      public List<Type> getConcreteClassTypeArguments()
      For generic types, returns a list of actual Class arguments. For example, for Set<String>, returns String. Non-concrete (like ?) or missing type arguments like are defaulted to Object.

      For array, returns List with Class.getComponentType()
    • prettyPrint

      public final String prettyPrint()
      Prints this object to String
    • prettyPrintBuilder

      protected PrettyPrintBuilder prettyPrintBuilder()
    • buildListOfConcreteTypeArguments

      protected static List<Type> buildListOfConcreteTypeArguments(Type baseJavaType, int expectedSize)