Class DefaultRoundedInstantFactory

java.lang.Object
com.broadleafcommerce.common.extension.cache.temporal.DefaultRoundedInstantFactory
All Implemented Interfaces:
RoundedInstantFactory

public class DefaultRoundedInstantFactory extends Object implements RoundedInstantFactory
Default instance of RoundedInstantFactory.
Author:
Jeff Fischer
  • Constructor Details

    • DefaultRoundedInstantFactory

      public DefaultRoundedInstantFactory(CacheProperties cacheProperties)
  • Method Details

    • roundNow

      public RoundedInstant roundNow(@Nullable TemporalIdentifier temporalIdentifier)
      Description copied from interface: RoundedInstantFactory
      Given a TemporalIdentifier instance, return a rounded version of the current instance in time based on an increment modulus. Also, return the specific instance of current time. The rounded version is useful as a cache key by reducing the jitter.
      Specified by:
      roundNow in interface RoundedInstantFactory
      Parameters:
      temporalIdentifier - The TemporalIdentifier instance that can generate the target, specific current time.
      Returns:
      The current, specific time and the rounded time.