Class UUIDType

  • All Implemented Interfaces:
    java.util.Comparator<java.nio.ByteBuffer>, AssignmentTestable

    public class UUIDType
    extends AbstractType<java.util.UUID>
    Compares UUIDs using the following criteria:
    - if count of supplied bytes is less than 16, compare counts
    - compare UUID version fields
    - nil UUID is always lesser
    - compare timestamps if both are time-based
    - compare lexically, unsigned msb-to-lsb comparison
    See Also:
    "com.fasterxml.uuid.UUIDComparator"
    • Field Detail

      • instance

        public static final UUIDType instance
    • Method Detail

      • compareCustom

        public <VL,​VR> int compareCustom​(VL left,
                                               ValueAccessor<VL> accessorL,
                                               VR right,
                                               ValueAccessor<VR> accessorR)
        Description copied from class: AbstractType
        Implement IFF ComparisonType is CUSTOM Compares the byte representation of two instances of this class, for types where this cannot be done by simple in-order comparison of the unsigned bytes Standard Java compare semantics
        Overrides:
        compareCustom in class AbstractType<java.util.UUID>
      • isValueCompatibleWithInternal

        public boolean isValueCompatibleWithInternal​(AbstractType<?> otherType)
        Description copied from class: AbstractType
        Needed to handle ReversedType in value-compatibility checks. Subclasses should implement this instead of isValueCompatibleWith().
        Overrides:
        isValueCompatibleWithInternal in class AbstractType<java.util.UUID>
      • valueLengthIfFixed

        public int valueLengthIfFixed()
        Description copied from class: AbstractType
        The length of values for this type if all values are of fixed length, -1 otherwise.
        Overrides:
        valueLengthIfFixed in class AbstractType<java.util.UUID>