Class SimpleDateType

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

    public class SimpleDateType
    extends TemporalType<java.lang.Integer>
    • Method Detail

      • fromTimeInMillis

        public java.nio.ByteBuffer fromTimeInMillis​(long millis)
                                             throws MarshalException
        Description copied from class: TemporalType
        Returns the temporal value corresponding to the specified UNIX timestamp.
        Overrides:
        fromTimeInMillis in class TemporalType<java.lang.Integer>
        Parameters:
        millis - the UNIX timestamp to convert
        Returns:
        the temporal value corresponding to the specified UNIX timestamp
        Throws:
        MarshalException
      • toTimeInMillis

        public long toTimeInMillis​(java.nio.ByteBuffer buffer)
                            throws MarshalException
        Description copied from class: TemporalType
        Converts this temporal in UNIX timestamp.
        Overrides:
        toTimeInMillis in class TemporalType<java.lang.Integer>
        Parameters:
        buffer - the temporal value.
        Returns:
        the UNIX timestamp corresponding to this temporal.
        Throws:
        MarshalException
      • 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.lang.Integer>
      • toJSONString

        public java.lang.String toJSONString​(java.nio.ByteBuffer buffer,
                                             ProtocolVersion protocolVersion)
        Description copied from class: AbstractType
        Converts the specified value into its JSON representation.

        The buffer position will stay the same.

        Overrides:
        toJSONString in class AbstractType<java.lang.Integer>
        Parameters:
        buffer - the value to convert
        protocolVersion - the protocol version to use for the conversion
        Returns:
        a JSON string representing the specified value
      • validateDuration

        protected void validateDuration​(Duration duration)
        Description copied from class: TemporalType
        Validates that the duration has the correct precision.
        Overrides:
        validateDuration in class TemporalType<java.lang.Integer>
        Parameters:
        duration - the duration to validate.