Package com.google.gson.internal
Class PreJava9DateFormatProvider
- java.lang.Object
-
- com.google.gson.internal.PreJava9DateFormatProvider
-
public class PreJava9DateFormatProvider extends java.lang.Object
Provides DateFormats for US locale with patterns which were the default ones before Java 9.
-
-
Constructor Summary
Constructors Constructor Description PreJava9DateFormatProvider()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
getDateFormatPattern(int style)
private static java.lang.String
getDatePartOfDateTimePattern(int dateStyle)
private static java.lang.String
getTimePartOfDateTimePattern(int timeStyle)
static java.text.DateFormat
getUSDateFormat(int style)
Returns the same DateFormat asDateFormat.getDateInstance(style, Locale.US)
in Java 8 or below.static java.text.DateFormat
getUSDateTimeFormat(int dateStyle, int timeStyle)
Returns the same DateFormat asDateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.US)
in Java 8 or below.
-
-
-
Method Detail
-
getUSDateFormat
public static java.text.DateFormat getUSDateFormat(int style)
Returns the same DateFormat asDateFormat.getDateInstance(style, Locale.US)
in Java 8 or below.
-
getUSDateTimeFormat
public static java.text.DateFormat getUSDateTimeFormat(int dateStyle, int timeStyle)
Returns the same DateFormat asDateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.US)
in Java 8 or below.
-
getDateFormatPattern
private static java.lang.String getDateFormatPattern(int style)
-
getDatePartOfDateTimePattern
private static java.lang.String getDatePartOfDateTimePattern(int dateStyle)
-
getTimePartOfDateTimePattern
private static java.lang.String getTimePartOfDateTimePattern(int timeStyle)
-
-