public static class PropertiesQuestion.IntConstraints extends PropertiesQuestion.ValueConstraints
Modifier and Type | Field and Description |
---|---|
protected boolean |
custom
Is the user allowed to supply their own value or are they required
to use one of the suggestions?
|
protected int[] |
suggestions
Suggested values for this value's response.
|
Constructor and Description |
---|
IntConstraints() |
IntConstraints(int[] suggestions)
Construct with suggested values for the user.
|
IntConstraints(int min,
int max)
Construct with defined upper and lower value boundaries.
|
IntConstraints(int min,
int max,
int[] suggestions) |
Modifier and Type | Method and Description |
---|---|
int |
getLowerBound()
Get the lower bound which specifies the minimum possible value to be
considered a valid response from the user.
|
int[] |
getSuggestions()
Get the suggested values.
|
int |
getUpperBound()
Get the upper bound which specifies the maximum possible value to be
considered a valid response from the user.
|
boolean |
isCustomValuesAllowed()
Are custom user values allowed?
|
java.lang.String |
isValid(int v)
Is the given value valid for this field?
|
java.lang.String |
isValid(java.lang.String v)
Is the given value valid for this field? The basic check for
validity is to see if the given string can be parsed as an
integer value in the current locale.
|
void |
setBounds(int min,
int max)
Set the max/min possible value that should be considered
valid.
|
void |
setCustomValuesAllowed(boolean state)
Are user specified values allowed? If not, there must be
suggestions present.
|
void |
setSuggestions(int[] sugs)
Supply some possible values that the user may want to
select from.
|
isReadOnly, isUnsetAllowed, isVisible, setReadOnly, setUnsetAllowed, setVisible
protected int[] suggestions
protected boolean custom
public IntConstraints()
public IntConstraints(int min, int max)
min
- Minimum valid response value (inclusive).max
- Maximum valid response value (inclusive).public IntConstraints(int[] suggestions)
suggestions
- Predefined values for the user to choose from.setCustomValuesAllowed(boolean)
public IntConstraints(int min, int max, int[] suggestions)
min
- Minimum valid response value (inclusive).max
- Maximum valid response value (inclusive).suggestions
- Predefined values for the user to choose from.setBounds(int, int)
public void setBounds(int min, int max)
getLowerBound()
,
getUpperBound()
public int getLowerBound()
public int getUpperBound()
public int[] getSuggestions()
public void setCustomValuesAllowed(boolean state)
java.lang.IllegalStateException
- If no suggestions have been
provided.setSuggestions(int[])
public boolean isCustomValuesAllowed()
public void setSuggestions(int[] sugs)
public java.lang.String isValid(java.lang.String v)
isValid
in class PropertiesQuestion.ValueConstraints
v
- The value to check.PropertiesQuestion.getInvalidKeys()
public java.lang.String isValid(int v)
Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.