Class TimeField

java.lang.Object
org.apache.guacamole.form.Field
org.apache.guacamole.form.TimeField

public class TimeField extends Field
Represents a time field. The field may contain only time values which conform to a standard pattern, defined by TimeField.FORMAT.
  • Field Details

    • FORMAT

      public static final String FORMAT
      The time format used by time fields, compatible with SimpleDateFormat.
      See Also:
  • Constructor Details

    • TimeField

      public TimeField(String name)
      Creates a new TimeField with the given name.
      Parameters:
      name - The unique name to associate with this field.
  • Method Details

    • parse

      public static Date parse(String timeString) throws ParseException
      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

      public static String format(Date time)
      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.