Class 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 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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