Package com.google.gwt.core.ext
Class DefaultSelectionProperty
java.lang.Object
com.google.gwt.core.ext.DefaultSelectionProperty
- All Implemented Interfaces:
SelectionProperty
Default immutable implementation of SelectionProperty that receives its
values in its constructor.
-
Constructor Summary
ConstructorDescriptionDefaultSelectionProperty
(String currentValue, String fallbackValue, String name, SortedSet<String> possibleValues) Construct a selection property.DefaultSelectionProperty
(String currentValue, String fallbackValue, String name, SortedSet<String> possibleValues, Map<String, ? extends List<? extends Set<String>>> fallbackValueMap) Construct a selection property. -
Method Summary
Modifier and TypeMethodDescriptionboolean
The value for the permutation currently being considered.Gets the fallback value for the property.getFallbackValues
(String value) Returns the list of fall back values for a given value.getName()
The name of the property.Returns the possible values for the property in sorted order.int
hashCode()
toString()
-
Constructor Details
-
DefaultSelectionProperty
public DefaultSelectionProperty(String currentValue, String fallbackValue, String name, SortedSet<String> possibleValues) Construct a selection property.- Parameters:
currentValue
- current value of this property, must not be nullfallbackValue
- the fallback value to use, must not be nullname
- the name of this property, must not be nullpossibleValues
- the set of possible values, must not be null and will be returned to callers, so a copy should be passed into this ctor if the caller will use this set later
-
DefaultSelectionProperty
public DefaultSelectionProperty(String currentValue, String fallbackValue, String name, SortedSet<String> possibleValues, Map<String, ? extends List<? extends Set<String>>> fallbackValueMap) Construct a selection property.- Parameters:
currentValue
- current value of this property, must not be nullfallbackValue
- the fallback value to use, must not be nullname
- the name of this property, must not be nullpossibleValues
- the set of possible values, must not be null and will be returned to callers, so a copy should be passed into this ctor if the caller will use this set laterfallbackValueMap
- the map propertyValue to fallback values
-
-
Method Details
-
equals
-
getCurrentValue
Description copied from interface:SelectionProperty
The value for the permutation currently being considered.- Specified by:
getCurrentValue
in interfaceSelectionProperty
- Returns:
- the property value as a String.
-
getFallbackValue
Description copied from interface:SelectionProperty
Gets the fallback value for the property.- Specified by:
getFallbackValue
in interfaceSelectionProperty
- Returns:
- the fallback, or ""
-
getFallbackValues
Description copied from interface:SelectionProperty
Returns the list of fall back values for a given value.- Specified by:
getFallbackValues
in interfaceSelectionProperty
- Parameters:
value
- the property value- Returns:
- the fall back list of values by increasing order of preference.
-
getName
Description copied from interface:SelectionProperty
The name of the property.- Specified by:
getName
in interfaceSelectionProperty
- Returns:
- the property name as a String.
-
getPossibleValues
Description copied from interface:SelectionProperty
Returns the possible values for the property in sorted order.- Specified by:
getPossibleValues
in interfaceSelectionProperty
- Returns:
- a SortedSet of Strings containing the possible property values.
-
hashCode
public int hashCode() -
toString
-