Package com.jscape.util.reflection.types
Class ChoiceField
- java.lang.Object
-
- com.jscape.util.reflection.FieldType
-
- com.jscape.util.reflection.types.ChoiceField
-
public class ChoiceField extends FieldType
Drop-down choice field component.
-
-
Constructor Summary
Constructors Constructor Description ChoiceField(boolean optional)Creates new instance with empty String options.ChoiceField(boolean optional, boolean multiple, java.lang.String... variants)Creates new instance of String options.ChoiceField(boolean optional, java.lang.String... variants)Creates new instance of String options.ChoiceField(java.lang.String... variants)Creates new instance of String options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ChoiceFieldcreateRangeChoice(int lowerBound, int upperBound)Creates new instance using integer range.static ChoiceFieldcreateRangeChoice(int lowerBound, int upperBound, boolean optional)Creates new instance using integer range.java.lang.String[]getVariants()Returns field variants.booleanisMultiple()Returns if field is multiple.booleanisOptional()Returns if field is optional.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ChoiceField
public ChoiceField(boolean optional, boolean multiple, java.lang.String... variants)Creates new instance of String options.- Parameters:
optional- if field is optionalmultiple- if field is multiplevariants- the string variants
-
ChoiceField
public ChoiceField(boolean optional, java.lang.String... variants)Creates new instance of String options.- Parameters:
variants- the string variantsoptional- if field is optional
-
ChoiceField
public ChoiceField(java.lang.String... variants)
Creates new instance of String options.- Parameters:
variants- the string variants
-
ChoiceField
public ChoiceField(boolean optional)
Creates new instance with empty String options.- Parameters:
optional- if field is optional
-
-
Method Detail
-
createRangeChoice
public static ChoiceField createRangeChoice(int lowerBound, int upperBound)
Creates new instance using integer range.- Parameters:
lowerBound- the lower boundupperBound- the upper bound- Returns:
- a choice field
-
createRangeChoice
public static ChoiceField createRangeChoice(int lowerBound, int upperBound, boolean optional)
Creates new instance using integer range.- Parameters:
lowerBound- the lower boundupperBound- the upper boundoptional- if field is optional- Returns:
- a choice field
-
getVariants
public java.lang.String[] getVariants()
Returns field variants.- Returns:
- the string variants
-
isMultiple
public boolean isMultiple()
Returns if field is multiple.- Returns:
trueif field is multiple
-
isOptional
public boolean isOptional()
Returns if field is optional.- Returns:
trueif field is optional
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-