Package com.hazelcast.jet.datamodel
Class TimestampedItem<T>
- java.lang.Object
-
- com.hazelcast.jet.datamodel.TimestampedItem<T>
-
- Type Parameters:
T
-
public class TimestampedItem<T> extends java.lang.Object
Mutable wrapper around an item that adds a timestamp. Useful for LRU caching.
-
-
Constructor Summary
Constructors Constructor Description TimestampedItem(long timestamp, T item)
Creates a new timestamped item.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
hashCode()
T
item()
Returns the item.TimestampedItem<T>
setItem(T item)
Sets the item.TimestampedItem<T>
setTimestamp(long timestamp)
Sets the timestamp.long
timestamp()
Returns the timestamp.java.lang.String
toString()
-
-
-
Constructor Detail
-
TimestampedItem
public TimestampedItem(long timestamp, T item)
Creates a new timestamped item.
-
-
Method Detail
-
timestamp
public long timestamp()
Returns the timestamp.
-
item
public T item()
Returns the item.
-
setTimestamp
public TimestampedItem<T> setTimestamp(long timestamp)
Sets the timestamp.- Returns:
this
-
setItem
public TimestampedItem<T> setItem(T item)
Sets the item.- Returns:
this
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-