Class Timestamped<T>

  • Type Parameters:
    T - Timestamped value type

    public final class Timestamped<T>
    extends Object
    Wrapper class to store Timestamped value.
    • Constructor Detail

      • Timestamped

        public Timestamped​(T value,
                           org.onosproject.store.Timestamp timestamp)
        Creates a time stamped value.
        Parameters:
        value - to be timestamp
        timestamp - the timestamp
    • Method Detail

      • value

        public T value()
        Returns the value.
        Returns:
        value
      • timestamp

        public org.onosproject.store.Timestamp timestamp()
        Returns the time stamp.
        Returns:
        time stamp
      • isNewer

        public boolean isNewer​(Timestamped<T> other)
        Tests if this timestamped value is newer than the other.
        Parameters:
        other - timestamped value
        Returns:
        true if this instance is newer.
      • isNewerThan

        public boolean isNewerThan​(org.onosproject.store.Timestamp other)
        Tests if this timestamp is newer than the specified timestamp.
        Parameters:
        other - timestamp to compare against
        Returns:
        true if this instance is newer
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object