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_NEW_FORMAT_SPECIFIERS  
  • 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • USE_NEW_FORMAT_SPECIFIERS

      public static final java.lang.String USE_NEW_FORMAT_SPECIFIERS
      See Also:
      Constant Field Values
  • Constructor Details

    • JodaDeprecationPatterns

      public JodaDeprecationPatterns()
  • Method Details

    • 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 from FormatNames 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