Package de.xima.fc.gui.common.converter
Class DurationPartsConverter
- java.lang.Object
-
- de.xima.fc.gui.common.converter.DurationPartsConverter
-
- All Implemented Interfaces:
IComponentValueConverter<Duration,String>
@Immutable public class DurationPartsConverter extends Object implements IComponentValueConverter<Duration,String>
AIComponentValueConverter
for splitting aDuration
field into its components.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description static IComponentValueConverter<Duration,String>
DAYS_HOURS_MINUTES
The immutable, thread-safe instance of a converter for splitting aDuration
field into its days, hours, and minutes.static IComponentValueConverter<Duration,String>
WEEKS_DAYS_HOURS
The immutable, thread-safe instance of a converter for splitting aDuration
field into its weeks, days, and hours.
-
Constructor Summary
Constructors Constructor Description DurationPartsConverter(TemporalUnit[] units)
Creates a new parts converter with the given parts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Duration
componentToExternalValue(IConvertibleMap<String> componentValues)
IConvertibleMap<String>
externalToComponentValue(Duration duration)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.gui.component.convertible.IComponentValueConverter
createOptions, newConvertibleMap
-
-
-
-
Field Detail
-
DAYS_HOURS_MINUTES
public static final IComponentValueConverter<Duration,String> DAYS_HOURS_MINUTES
The immutable, thread-safe instance of a converter for splitting aDuration
field into its days, hours, and minutes.
-
WEEKS_DAYS_HOURS
public static final IComponentValueConverter<Duration,String> WEEKS_DAYS_HOURS
The immutable, thread-safe instance of a converter for splitting aDuration
field into its weeks, days, and hours.
-
-
Constructor Detail
-
DurationPartsConverter
public DurationPartsConverter(TemporalUnit[] units)
Creates a new parts converter with the given parts.- Parameters:
units
- The units (bases) of the parts to extract.
-
-
Method Detail
-
componentToExternalValue
public Duration componentToExternalValue(IConvertibleMap<String> componentValues)
- Specified by:
componentToExternalValue
in interfaceIComponentValueConverter<Duration,String>
- Parameters:
componentValues
- The value on the component.- Returns:
- The value to be set on the backing bean or model.
-
externalToComponentValue
public IConvertibleMap<String> externalToComponentValue(Duration duration)
- Specified by:
externalToComponentValue
in interfaceIComponentValueConverter<Duration,String>
- Parameters:
duration
- The value on the backing bean or the model.- Returns:
- A map of values to be used on the component. In your xhtml, you can use the key you assign here to access the value.
-
-