Package org.elasticsearch.common.joda
Class JodaDeprecationPatterns
- java.lang.Object
-
- org.elasticsearch.common.joda.JodaDeprecationPatterns
-
public class JodaDeprecationPatterns extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
USE_PREFIX_8_WARNING
-
Constructor Summary
Constructors Constructor Description JodaDeprecationPatterns()
-
Method Summary
Modifier and Type Method Description static java.lang.String
formatSuggestion(java.lang.String pattern)
Formats deprecation message for suggestion field in a warning header.static boolean
isDeprecatedPattern(java.lang.String pattern)
Checks if date parsing pattern is deprecated.
-
-
-
Field Detail
-
USE_PREFIX_8_WARNING
public static final java.lang.String USE_PREFIX_8_WARNING
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDeprecatedPattern
public static boolean isDeprecatedPattern(java.lang.String pattern)
Checks if date parsing pattern is deprecated. Deprecated here means: when it was not already prefixed with 8 (meaning already upgraded) and it is not a predefined pattern fromFormatNames
like basic_date_time_no_millis and it uses pattern characters which changed meaning from joda to java like Y becomes y.- Parameters:
pattern
- - a format to be checked- Returns:
- true if format is deprecated, otherwise false
-
formatSuggestion
public static java.lang.String formatSuggestion(java.lang.String pattern)
Formats deprecation message for suggestion field in a warning header. Joins all warnings in a one message.- Parameters:
pattern
- - a pattern to be formatted- Returns:
- a formatted deprecation message
-
-