Package com.bc.ceres.binding
Class ValueSet
- java.lang.Object
-
- com.bc.ceres.binding.ValueSet
-
public class ValueSet extends Object
A set of values allowed to be assigned to certain types of values. This set can be a property of aPropertyDescriptor
.- Since:
- 0.6
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Object value)
Object[]
getItems()
static ValueSet
parseValueSet(String[] valueStrings, Converter itemConverter)
Converts a string array into a value set.static ValueSet
parseValueSet(String text, Class<?> itemType)
Converts a comma-separated text string into a value set.
-
-
-
Constructor Detail
-
ValueSet
public ValueSet(Object[] items)
-
-
Method Detail
-
getItems
public Object[] getItems()
-
contains
public boolean contains(Object value)
-
parseValueSet
public static ValueSet parseValueSet(String text, Class<?> itemType) throws IllegalArgumentException
Converts a comma-separated text string into a value set.- Parameters:
text
- The textual representation of the value set. Commas in values must be escaped using UNICODE character encoding.itemType
- The type of the value set's items.- Returns:
- The value set.
- Throws:
IllegalArgumentException
- If the text has an invalid format.
-
parseValueSet
public static ValueSet parseValueSet(String[] valueStrings, Converter itemConverter) throws ConversionException
Converts a string array into a value set.- Parameters:
valueStrings
- The textual representation of the items of the value set.itemConverter
- The converter to be used for the item conversion.- Returns:
- The value set.
- Throws:
ConversionException
- If the conversion of one of the items fails.
-
-