Class CustomType<T>

  • Type Parameters:
    T - Custom Type
    All Implemented Interfaces:
    CustomComparableType

    public class CustomType<T>
    extends JaversType
    implements CustomComparableType
    Custom Types are not easy to manage, use it as a last resort,
    only for corner cases like comparing custom Collection types.


    JaVers treats a Custom Type as a black box and doesn't take any assumptions about its content or behaviour. It's a "not modeled" type, somehow similar to unbounded wildcard <?>.

    Objects of Custom Type are compared by a CustomPropertyComparator. Registering this comparator is the only way to map a Custom Type.

    Custom Types are serialized to JSON using Gson defaults.
    See Also:
    JaversBuilder.registerCustomType(Class, CustomPropertyComparator)
    • Constructor Detail

    • Method Detail

      • equals

        public boolean equals​(java.lang.Object left,
                              java.lang.Object right)
        Description copied from class: JaversType
        Used for comparing as Values
        Overrides:
        equals in class JaversType
      • isInstance

        public boolean isInstance​(java.lang.Object cdo)
        Specified by:
        isInstance in class JaversType
      • getRawDehydratedType

        protected java.lang.reflect.Type getRawDehydratedType()
        Type for JSON representation. For Values it's simply baseJavaType. For ManagedTypes (references to Entities and ValueObjects) it's GlobalId because JaVers serializes references in the 'dehydrated' form.
      • getBaseJavaClass

        public java.lang.Class getBaseJavaClass()