Class EntryLoader.MetadataAwareValue<V>

  • Type Parameters:
    V - the type of the value object
    Enclosing interface:
    EntryLoader<K,​V>

    public static class EntryLoader.MetadataAwareValue<V>
    extends java.lang.Object
    Represents a value with an expiration time attached to it. Expiration time is optional.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long NO_TIME_SET
      Represents no expiration time for a particular value
    • Constructor Summary

      Constructors 
      Constructor Description
      MetadataAwareValue​(V value)
      Creates a value without attaching an expiration time
      MetadataAwareValue​(V value, long expirationTime)
      Creates a value and attaches an expiration time to it.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getExpirationTime()
      The expiration date of this entry.
      V getValue()
      Returns the value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NO_TIME_SET

        public static final long NO_TIME_SET
        Represents no expiration time for a particular value
        See Also:
        Constant Field Values
    • Constructor Detail

      • MetadataAwareValue

        public MetadataAwareValue​(V value)
        Creates a value without attaching an expiration time
        Parameters:
        value - the value
      • MetadataAwareValue

        public MetadataAwareValue​(V value,
                                  long expirationTime)
        Creates a value and attaches an expiration time to it. See getExpirationTime() for how expiration time is defined.
        Parameters:
        value - the value
        expirationTime - expiration time associated with the value
    • Method Detail

      • getValue

        public V getValue()
        Returns the value
        Returns:
        the value
      • getExpirationTime

        public long getExpirationTime()
        The expiration date of this entry. The entry is removed from maps after the specified date. This value overrides any expiration time calculated by using ttl and idle time configurations, both per key and per map configurations.
        Returns:
        the difference, measured in milliseconds, between the expiration time and midnight, January 1, 1970 UTC.