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
Modifier and TypeFieldDescriptionprotected Messages
static final Pattern
protected RelativeDateTimeMomentProvider
Fields inherited from interface io.jmix.flowui.app.propertyfilter.dateinterval.converter.DateIntervalConverter
INCLUDING_CURRENT_DESCRIPTION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformat
(BaseDateInterval dateInterval) Formats date interval to string presentation.getLocalizedValue
(BaseDateInterval dateInterval) Formats date interval and gets localized value.protected RelativeDateInterval
getTypedDateInterval
(BaseDateInterval dateInterval) boolean
Checks that provided date interval matches with converter's value pattern.Parses string presentation of date interval toBaseDateInterval
.void
setMessages
(Messages messages) void
setRelativeDateTimeMomentProvider
(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:DateIntervalConverter
Parses string presentation of date interval toBaseDateInterval
.- Specified by:
parse
in 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:DateIntervalConverter
Formats date interval to string presentation.- Specified by:
format
in interfaceDateIntervalConverter
- Parameters:
dateInterval
- date interval instance- Returns:
- raw presentation of date interval
-
getLocalizedValue
Description copied from interface:DateIntervalConverter
Formats date interval and gets localized value.- Specified by:
getLocalizedValue
in interfaceDateIntervalConverter
- Parameters:
dateInterval
- date interval instance- Returns:
- localized value
-
matches
Description copied from interface:DateIntervalConverter
Checks that provided date interval matches with converter's value pattern.- Specified by:
matches
in interfaceDateIntervalConverter
- Parameters:
dateInterval
- string presentation of date interval- Returns:
true
if provided data interval matches with the value pattern of the converter,false
otherwise
-
supports
- Specified by:
supports
in interfaceDateIntervalConverter
- Parameters:
type
- date interval type- Returns:
true
if converter supports the given type,false
otherwise
-
getTypedDateInterval
-