Interface JavaTypeDescriptor<T>

    • Method Detail

      • getJavaTypeClass

        @Deprecated
        Class<T> getJavaTypeClass()
        Deprecated.
        Use getJavaType() instead
        Retrieve the Java type handled here.
        Returns:
        The Java type.
      • getJavaType

        default Class<T> getJavaType()
        Get the Java type described
      • getMutabilityPlan

        default MutabilityPlan<T> getMutabilityPlan()
        Retrieve the mutability plan for this Java type.
      • getComparator

        default Comparator<T> getComparator()
        Retrieve the natural comparator for this type.
      • extractHashCode

        default int extractHashCode​(T value)
        Extract a proper hash code for this value.
        Parameters:
        value - The value for which to extract a hash code.
        Returns:
        The extracted hash code.
      • areEqual

        default boolean areEqual​(T one,
                                 T another)
        Determine if two instances are equal
        Parameters:
        one - One instance
        another - The other instance
        Returns:
        True if the two are considered equal; false otherwise.
      • extractLoggableRepresentation

        default String extractLoggableRepresentation​(T value)
        Extract a loggable representation of the value.
        Parameters:
        value - The value for which to extract a loggable representation.
        Returns:
        The loggable representation
      • toString

        default String toString​(T value)
      • fromString

        T fromString​(String string)
      • unwrap

        <X> X unwrap​(T value,
                     Class<X> type,
                     WrapperOptions options)
        Unwrap an instance of our handled Java type into the requested type.

        As an example, if this is a JavaTypeDescriptor<Integer> and we are asked to unwrap the Integer value as a Long we would return something like Long.valueOf( value.longValue() ).

        Intended use is during PreparedStatement binding.

        Type Parameters:
        X - The conversion type.
        Parameters:
        value - The value to unwrap
        type - The type as which to unwrap
        options - The options
        Returns:
        The unwrapped value.
      • wrap

        <X> T wrap​(X value,
                   WrapperOptions options)
        Wrap a value as our handled Java type.

        Intended use is during ResultSet extraction.

        Type Parameters:
        X - The conversion type.
        Parameters:
        value - The value to wrap.
        options - The options
        Returns:
        The wrapped value.