Class Timestamped<T>

  • Type Parameters:
    T - Timestamped value type

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

      Constructors 
      Constructor Description
      Timestamped​(T value, org.onosproject.store.Timestamp timestamp)
      Creates a time stamped value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      boolean isNewer​(Timestamped<T> other)
      Tests if this timestamped value is newer than the other.
      boolean isNewerThan​(org.onosproject.store.Timestamp other)
      Tests if this timestamp is newer than the specified timestamp.
      org.onosproject.store.Timestamp timestamp()
      Returns the time stamp.
      java.lang.String toString()  
      T value()
      Returns the value.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object