Package org.apache.http.client.utils
Class DateUtils.DateFormatHolder
- java.lang.Object
-
- org.apache.http.client.utils.DateUtils.DateFormatHolder
-
- Enclosing class:
- DateUtils
static final class DateUtils.DateFormatHolder extends java.lang.ObjectA factory forSimpleDateFormats. The instances are stored in a threadlocal way because SimpleDateFormat is not threadsafe as noted inits javadoc.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<java.lang.ref.SoftReference<java.util.Map<java.lang.String,java.text.SimpleDateFormat>>>THREADLOCAL_FORMATS
-
Constructor Summary
Constructors Constructor Description DateFormatHolder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearThreadLocal()static java.text.SimpleDateFormatformatFor(java.lang.String pattern)creates aSimpleDateFormatfor the requested format string.
-
-
-
Method Detail
-
formatFor
public static java.text.SimpleDateFormat formatFor(java.lang.String pattern)
creates aSimpleDateFormatfor the requested format string.- Parameters:
pattern- a non-nullformat String according toSimpleDateFormat. The format is not checked againstnullsince all paths go throughDateUtils.- Returns:
- the requested format. This simple dateformat should not be used
to
applyto a different pattern.
-
clearThreadLocal
public static void clearThreadLocal()
-
-