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 ofRoundedInstantFactory
.- Author:
- Jeff Fischer
-
-
Constructor Summary
Constructors Constructor Description DefaultRoundedInstantFactory(CacheProperties cacheProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoundedInstant
roundNow(TemporalIdentifier temporalIdentifier)
Given aTemporalIdentifier
instance, return a rounded version of the current instance in time based on an increment modulus.
-
-
-
Constructor Detail
-
DefaultRoundedInstantFactory
public DefaultRoundedInstantFactory(CacheProperties cacheProperties)
-
-
Method Detail
-
roundNow
public RoundedInstant roundNow(@Nullable TemporalIdentifier temporalIdentifier)
Description copied from interface:RoundedInstantFactory
Given aTemporalIdentifier
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 interfaceRoundedInstantFactory
- Parameters:
temporalIdentifier
- TheTemporalIdentifier
instance that can generate the target, specific current time.- Returns:
- The current, specific time and the rounded time.
-
-