Class ConstantExpirationAfterWritePolicy

java.lang.Object
io.micronaut.configuration.lettuce.cache.expiration.ConstantExpirationAfterWritePolicy
All Implemented Interfaces:
ExpirationAfterWritePolicy

public class ConstantExpirationAfterWritePolicy extends Object implements ExpirationAfterWritePolicy
Provides a Cache TTL policy of constant time.
  • Constructor Details

    • ConstantExpirationAfterWritePolicy

      public ConstantExpirationAfterWritePolicy(long ttl)
      Parameters:
      ttl - ttl in milliseconds
  • Method Details

    • getExpirationAfterWrite

      public long getExpirationAfterWrite(Object value)
      Specified by:
      getExpirationAfterWrite in interface ExpirationAfterWritePolicy
      Parameters:
      value - Object that will be put in the cache (non-serialized)
      Returns:
      TTL of the document in Redis in milliseconds