Package org.onosproject.store.impl
Class Timestamped<T>
- java.lang.Object
-
- org.onosproject.store.impl.Timestamped<T>
-
- Type Parameters:
T- Timestamped value type
public final class Timestamped<T> extends java.lang.ObjectWrapper 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 booleanequals(java.lang.Object obj)inthashCode()booleanisNewer(Timestamped<T> other)Tests if this timestamped value is newer than the other.booleanisNewerThan(org.onosproject.store.Timestamp other)Tests if this timestamp is newer than the specified timestamp.org.onosproject.store.Timestamptimestamp()Returns the time stamp.java.lang.StringtoString()Tvalue()Returns the value.
-
-
-
Constructor Detail
-
Timestamped
public Timestamped(T value, org.onosproject.store.Timestamp timestamp)
Creates a time stamped value.- Parameters:
value- to be timestamptimestamp- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-