Package com.google.gwt.core.ext
Class DefaultSelectionProperty
- java.lang.Object
-
- com.google.gwt.core.ext.DefaultSelectionProperty
-
- All Implemented Interfaces:
SelectionProperty
public class DefaultSelectionProperty extends java.lang.Object implements SelectionProperty
Default immutable implementation of SelectionProperty that receives its values in its constructor.
-
-
Constructor Summary
Constructors Constructor Description DefaultSelectionProperty(java.lang.String currentValue, java.lang.String fallbackValue, java.lang.String name, java.util.SortedSet<java.lang.String> possibleValues)Construct a selection property.DefaultSelectionProperty(java.lang.String currentValue, java.lang.String fallbackValue, java.lang.String name, java.util.SortedSet<java.lang.String> possibleValues, java.util.Map<java.lang.String,? extends java.util.List<? extends java.util.Set<java.lang.String>>> fallbackValueMap)Construct a selection property.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetCurrentValue()The value for the permutation currently being considered.java.lang.StringgetFallbackValue()Gets the fallback value for the property.java.util.List<? extends java.util.Set<java.lang.String>>getFallbackValues(java.lang.String value)Returns the list of fall back values for a given value.java.lang.StringgetName()The name of the property.java.util.SortedSet<java.lang.String>getPossibleValues()Returns the possible values for the property in sorted order.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
DefaultSelectionProperty
public DefaultSelectionProperty(java.lang.String currentValue, java.lang.String fallbackValue, java.lang.String name, java.util.SortedSet<java.lang.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(java.lang.String currentValue, java.lang.String fallbackValue, java.lang.String name, java.util.SortedSet<java.lang.String> possibleValues, java.util.Map<java.lang.String,? extends java.util.List<? extends java.util.Set<java.lang.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 Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getCurrentValue
public java.lang.String getCurrentValue()
Description copied from interface:SelectionPropertyThe value for the permutation currently being considered.- Specified by:
getCurrentValuein interfaceSelectionProperty- Returns:
- the property value as a String.
-
getFallbackValue
public java.lang.String getFallbackValue()
Description copied from interface:SelectionPropertyGets the fallback value for the property.- Specified by:
getFallbackValuein interfaceSelectionProperty- Returns:
- the fallback, or ""
-
getFallbackValues
public java.util.List<? extends java.util.Set<java.lang.String>> getFallbackValues(java.lang.String value)
Description copied from interface:SelectionPropertyReturns the list of fall back values for a given value.- Specified by:
getFallbackValuesin interfaceSelectionProperty- Parameters:
value- the property value- Returns:
- the fall back list of values by increasing order of preference.
-
getName
public java.lang.String getName()
Description copied from interface:SelectionPropertyThe name of the property.- Specified by:
getNamein interfaceSelectionProperty- Returns:
- the property name as a String.
-
getPossibleValues
public java.util.SortedSet<java.lang.String> getPossibleValues()
Description copied from interface:SelectionPropertyReturns the possible values for the property in sorted order.- Specified by:
getPossibleValuesin interfaceSelectionProperty- Returns:
- a SortedSet of Strings containing the possible property values.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-