Package org.apache.guacamole.form
Class TimeField
java.lang.Object
org.apache.guacamole.form.Field
org.apache.guacamole.form.TimeField
Represents a time field. The field may contain only time values which
conform to a standard pattern, defined by TimeField.FORMAT.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.guacamole.form.Field
Field.Type
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.guacamole.form.Field
getName, getOptions, getType, setName, setOptions, setType
-
Field Details
-
FORMAT
The time format used by time fields, compatible with SimpleDateFormat.- See Also:
-
-
Constructor Details
-
TimeField
Creates a new TimeField with the given name.- Parameters:
name
- The unique name to associate with this field.
-
-
Method Details
-
parse
Parses the given string into a corresponding time. The string must follow the standard format used by time fields, as defined by FORMAT and as would be produced by format().- Parameters:
timeString
- The time string to parse, which may be null.- Returns:
- The time corresponding to the given time string, or null if the provided time string was null or blank.
- Throws:
ParseException
- If the given time string does not conform to the standard format used by time fields.
-
format
Converts the given time into a string which follows the format used by time fields.- Parameters:
time
- The time value to format, which may be null.- Returns:
- The formatted time, or null if the provided time was null.
-