Package org.apache.guacamole.form
Class NumericField
java.lang.Object
org.apache.guacamole.form.Field
org.apache.guacamole.form.NumericField
Represents a field which may contain only integer values.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.guacamole.form.Field
Field.Type
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.guacamole.form.Field
getName, getOptions, getType, setName, setOptions, setType
-
Constructor Details
-
NumericField
Creates a new NumericField with the given name.- Parameters:
name
- The unique name to associate with this field.
-
-
Method Details
-
format
Formats the given integer in the format required by a numeric field.- Parameters:
i
- The integer to format, which may be null.- Returns:
- A string representation of the given integer, or null if the given integer was null.
-
parse
Parses the given string as an integer, where the given string is in the format required by a numeric field.- Parameters:
str
- The string to parse as an integer, which may be null.- Returns:
- The integer representation of the given string, or null if the given string was null.
- Throws:
NumberFormatException
- If the given string is not in a parseable format.
-