Interface DateIntervalConverter

All Known Implementing Classes:
NextLastIntervalConverter, PredefinedIntervalConverter, RelativeIntervalConverter

public interface DateIntervalConverter
Interface provides methods for parsing/formating date interval values.
  • Field Details

  • Method Details

    • parse

      @Nullable BaseDateInterval parse(String dateInterval)
      Parses string presentation of date interval to BaseDateInterval.
      Parameters:
      dateInterval - string presentation of date interval
      Returns:
      configured date interval or null if input parameter is null or empty.
    • format

      String format(BaseDateInterval dateInterval)
      Formats date interval to string presentation.
      Parameters:
      dateInterval - date interval instance
      Returns:
      raw presentation of date interval
    • getLocalizedValue

      @Nullable String getLocalizedValue(@Nullable BaseDateInterval dateInterval)
      Formats date interval and gets localized value.
      Parameters:
      dateInterval - date interval instance
      Returns:
      localized value
    • matches

      boolean matches(String dateInterval)
      Checks that provided date interval matches with converter's value pattern.
      Parameters:
      dateInterval - string presentation of date interval
      Returns:
      true if provided date interval matches with the value pattern of the converter
    • supports

      boolean supports(BaseDateInterval.Type type)
      Parameters:
      type - date interval type
      Returns:
      true if converter supports the given type