Class RelativeIntervalConverter
java.lang.Object
io.jmix.flowuidata.dateinterval.converter.RelativeIntervalConverter
- All Implemented Interfaces:
DateIntervalConverter
@Component("flowui_UiDataRelativeIntervalConverter")
public class RelativeIntervalConverter
extends Object
implements DateIntervalConverter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Messagesstatic final Patternprotected RelativeDateTimeMomentProviderFields inherited from interface io.jmix.flowui.app.propertyfilter.dateinterval.converter.DateIntervalConverter
INCLUDING_CURRENT_DESCRIPTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat(BaseDateInterval dateInterval) Formats date interval to string presentation.getLocalizedValue(BaseDateInterval dateInterval) Formats date interval and gets localized value.protected RelativeDateIntervalgetTypedDateInterval(BaseDateInterval dateInterval) booleanChecks that provided date interval matches with converter's value pattern.Parses string presentation of date interval toBaseDateInterval.voidsetMessages(Messages messages) voidsetRelativeDateTimeMomentProvider(RelativeDateTimeMomentProvider relativeDateTimeMomentProvider) boolean
-
Field Details
-
RELATIVE_PATTERN
-
messages
-
relativeDateTimeMomentProvider
-
-
Constructor Details
-
RelativeIntervalConverter
public RelativeIntervalConverter()
-
-
Method Details
-
setMessages
-
setRelativeDateTimeMomentProvider
@Autowired public void setRelativeDateTimeMomentProvider(RelativeDateTimeMomentProvider relativeDateTimeMomentProvider) -
parse
Description copied from interface:DateIntervalConverterParses string presentation of date interval toBaseDateInterval.- Specified by:
parsein interfaceDateIntervalConverter- Parameters:
dateInterval- string presentation of date interval- Returns:
- configured date interval or null if input parameters is null or empty.
-
format
Description copied from interface:DateIntervalConverterFormats date interval to string presentation.- Specified by:
formatin interfaceDateIntervalConverter- Parameters:
dateInterval- date interval instance- Returns:
- raw presentation of date interval
-
getLocalizedValue
Description copied from interface:DateIntervalConverterFormats date interval and gets localized value.- Specified by:
getLocalizedValuein interfaceDateIntervalConverter- Parameters:
dateInterval- date interval instance- Returns:
- localized value
-
matches
Description copied from interface:DateIntervalConverterChecks that provided date interval matches with converter's value pattern.- Specified by:
matchesin interfaceDateIntervalConverter- Parameters:
dateInterval- string presentation of date interval- Returns:
trueif provided data interval matches with the value pattern of the converter,falseotherwise
-
supports
- Specified by:
supportsin interfaceDateIntervalConverter- Parameters:
type- date interval type- Returns:
trueif converter supports the given type,falseotherwise
-
getTypedDateInterval
-