Class ValueAndTimestamp<V>

  • Type Parameters:
    V -

    public final class ValueAndTimestamp<V>
    extends Object
    Combines a value from a KeyValue with a timestamp.
    • Method Detail

      • make

        public static <V> ValueAndTimestamp<V> make​(V value,
                                                    long timestamp)
        Create a new ValueAndTimestamp instance if the provide value is not null.
        Type Parameters:
        V - the type of the value
        Parameters:
        value - the value
        timestamp - the timestamp
        Returns:
        a new ValueAndTimestamp instance if the provide value is not null; otherwise null is returned
      • getValueOrNull

        public static <V> V getValueOrNull​(ValueAndTimestamp<V> valueAndTimestamp)
        Return the wrapped value of the given valueAndTimestamp parameter if the parameter is not null.
        Type Parameters:
        V - the type of the value
        Parameters:
        valueAndTimestamp - a ValueAndTimestamp instance; can be null
        Returns:
        the wrapped value of valueAndTimestamp if not null; otherwise null
      • value

        public V value()
      • timestamp

        public long timestamp()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object