Class DateTimeFormatterConverter

java.lang.Object
com.github.joschi.jadconfig.jodatime.converters.DateTimeFormatterConverter
All Implemented Interfaces:
Converter<org.joda.time.format.DateTimeFormatter>

public class DateTimeFormatterConverter extends Object implements Converter<org.joda.time.format.DateTimeFormatter>
Converter for type DateTimeFormatter
Author:
jschalanda
See Also:
  • DateTimeFormat
  • DateTimeFormatter
  • Constructor Details

    • DateTimeFormatterConverter

      public DateTimeFormatterConverter()
  • Method Details

    • convertFrom

      public org.joda.time.format.DateTimeFormatter convertFrom(String value)
      Returns a DateTimeFormatter instance representing the specified pattern.
      Specified by:
      convertFrom in interface Converter<org.joda.time.format.DateTimeFormatter>
      Parameters:
      value - The configuration parameter's String value
      Returns:
      A DateTimeFormatter instance representing the configuration parameter's value
      See Also:
      • DateTimeFormat.forPattern(String)
    • convertTo

      public String convertTo(org.joda.time.format.DateTimeFormatter value)
      Returns an empty String since getting the original pattern from a DateTimeFormatter isn't supported by Joda-Time.
      Specified by:
      convertTo in interface Converter<org.joda.time.format.DateTimeFormatter>
      Parameters:
      value - The configuration parameter's DateTimeFormatter value
      Returns:
      An empty String