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>
A
IComponentValueConverter for splitting a Duration field into its components.- Author:
- XIMA MEDIA GmbH
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IComponentValueConverter<Duration,String> The immutable, thread-safe instance of a converter for splitting aDurationfield into its days, hours, and minutes.static final IComponentValueConverter<Duration,String> The immutable, thread-safe instance of a converter for splitting aDurationfield into its weeks, days, and hours. -
Constructor Summary
ConstructorsConstructorDescriptionDurationPartsConverter(TemporalUnit[] units) Creates a new parts converter with the given parts. -
Method Summary
Modifier and TypeMethodDescriptioncomponentToExternalValue(IConvertibleMap<String> componentValues) externalToComponentValue(Duration duration) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.fc.gui.component.convertible.IComponentValueConverter
createOptions, newConvertibleMap
-
Field Details
-
Constructor Details
-
DurationPartsConverter
Creates a new parts converter with the given parts.- Parameters:
units- The units (bases) of the parts to extract.
-
-
Method Details
-
componentToExternalValue
- Specified by:
componentToExternalValuein interfaceIComponentValueConverter<Duration,String> - Parameters:
componentValues- The value on the component.- Returns:
- The value to be set on the backing bean or model.
-
externalToComponentValue
- Specified by:
externalToComponentValuein 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.
-