@ThreadSafe @Singleton public final class DateTimeFormatterCache extends Cache<DateTimeFormatterPattern,DateTimeFormatter>
DateTimeFormatter instances. It
caches up to a limited number of compiled DateTimeFormatter objects.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CACHE_SIZE
The default number of items to keep in the cache
|
DEFAULT_ALLOW_NULL_VALUESm_aRWLock, NO_MAX_SIZE, STATISTICS_PREFIX| Modifier and Type | Method and Description |
|---|---|
static DateTimeFormatter |
getDateTimeFormatter(String sPattern,
ResolverStyle eResolverStyle)
Get the cached DateTimeFormatter using the provided resolver style.
|
static DateTimeFormatter |
getDateTimeFormatterLenient(String sPattern)
Get the cached DateTimeFormatter using LENIENT resolving.
|
static DateTimeFormatter |
getDateTimeFormatterSmart(String sPattern)
Get the cached DateTimeFormatter using SMART resolving.
|
static DateTimeFormatter |
getDateTimeFormatterStrict(String sPattern)
Get the cached DateTimeFormatter using STRICT resolving.
|
static DateTimeFormatterCache |
getInstance() |
static boolean |
isInstantiated() |
clearCache, createCache, getCacheKeyProvider, getFromCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getMaxSize, getName, getValueProvider, hasMaxSize, isAllowNullValues, isEmpty, isInCache, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, size, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComparatorCollating, getComparatorNamepublic static final int MAX_CACHE_SIZE
public static boolean isInstantiated()
@Nonnull public static DateTimeFormatterCache getInstance()
@Nonnull public static DateTimeFormatter getDateTimeFormatterStrict(@Nonnull @Nonempty String sPattern)
sPattern - The pattern to retrieve. May neither be null nor empty.null .IllegalArgumentException - If the pattern is invalid@Nonnull public static DateTimeFormatter getDateTimeFormatterSmart(@Nonnull @Nonempty String sPattern)
sPattern - The pattern to retrieve. May neither be null nor empty.null .IllegalArgumentException - If the pattern is invalid@Nonnull public static DateTimeFormatter getDateTimeFormatterLenient(@Nonnull @Nonempty String sPattern)
sPattern - The pattern to retrieve. May neither be null nor empty.null .IllegalArgumentException - If the pattern is invalid@Nonnull public static DateTimeFormatter getDateTimeFormatter(@Nonnull @Nonempty String sPattern, @Nonnull ResolverStyle eResolverStyle)
sPattern - The pattern to retrieve. May neither be null nor empty.eResolverStyle - The resolver style to be used. May not be null.null.IllegalArgumentException - If the pattern is invalidCopyright © 2014–2022 Philip Helger. All rights reserved.