# Class LocalTimeStringConverter

java.lang.Object
javafx.util.StringConverter<LocalTime>
javafx.util.converter.LocalTimeStringConverter

public class LocalTimeStringConverter extends StringConverter<LocalTime>

`StringConverter` implementation for `LocalTime` values.

Since:
  JavaFX 8u40
See Also:
  - `LocalDateStringConverter`
  - `LocalDateTimeStringConverter`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LocalTimeStringConverter()`
  Create a `StringConverter` for `LocalTime` values, using a default formatter and parser with `FormatStyle.SHORT`, and the user's `Locale`.
  `LocalTimeStringConverter(DateTimeFormatter formatter, DateTimeFormatter parser)`
  Create a StringConverter for `LocalTime` values using the supplied formatter and parser, which are responsible for choosing the desired `Locale`.
  `LocalTimeStringConverter(FormatStyle timeStyle)`
  Create a `StringConverter` for `LocalTime` values, using a default formatter and parser with the specified `FormatStyle` and based on the user's `Locale`.
  `LocalTimeStringConverter(FormatStyle timeStyle, Locale locale)`
  Create a StringConverter for `LocalTime` values, using a default formatter and parser with the specified `FormatStyle` and `Locale`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LocalTime`
  `fromString(String value)`
  Converts the string provided into an object defined by the specific converter.
  `String`
  `toString(LocalTime value)`
  Converts the object provided into its string form.

  ### Methods declared in class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### LocalTimeStringConverter

    public LocalTimeStringConverter()
    Create a `StringConverter` for `LocalTime` values, using a default formatter and parser with `FormatStyle.SHORT`, and the user's `Locale`.

  - ### LocalTimeStringConverter

    public LocalTimeStringConverter(FormatStyle timeStyle)
    Create a `StringConverter` for `LocalTime` values, using a default formatter and parser with the specified `FormatStyle` and based on the user's `Locale`.
    Parameters:
      `timeStyle` - The `FormatStyle` that will be used by the default formatter and parser. If null then `FormatStyle.SHORT` will be used.

  - ### LocalTimeStringConverter

    public LocalTimeStringConverter(FormatStyle timeStyle, Locale locale)
    Create a StringConverter for `LocalTime` values, using a default formatter and parser with the specified `FormatStyle` and `Locale`.
    Parameters:
      `timeStyle` - The `FormatStyle` that will be used by the default formatter and parser. If null then `FormatStyle.SHORT` will be used.
      `locale` - The `Locale` that will be used by the default formatter and parser. If null then `Locale.getDefault(Locale.Category.FORMAT)` will be used.

  - ### LocalTimeStringConverter

    public LocalTimeStringConverter(DateTimeFormatter formatter, DateTimeFormatter parser)
    Create a StringConverter for `LocalTime` values using the supplied formatter and parser, which are responsible for choosing the desired `Locale`.

    For example, a fixed pattern can be used for converting both ways:

    >      String pattern = "HH:mm:ss";
    >      DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
    >      StringConverter<LocalTime> converter =
    >          DateTimeStringConverter.getLocalTimeConverter(formatter, null);

    Parameters:
      `formatter` - An instance of `DateTimeFormatter` which will be used for formatting by the toString() method. If null then a default formatter will be used.
      `parser` - An instance of `DateTimeFormatter` which will be used for parsing by the fromString() method. This can be identical to formatter. If null, then formatter will be used, and if that is also null, then a default parser will be used.

- ## Method Details

  - ### fromString

    public LocalTime fromString(String value)
    Converts the string provided into an object defined by the specific converter. Format of the string and type of the resulting object is defined by the specific converter.
    Specified by:
      `fromString` in class `StringConverter<LocalTime>`
    Parameters:
      `value` - the `String` to convert
    Returns:
      an object representation of the string passed in.

  - ### toString

    public String toString(LocalTime value)
    Converts the object provided into its string form. Format of the returned string is defined by the specific converter.
    Specified by:
      `toString` in class `StringConverter<LocalTime>`
    Parameters:
      `value` - the object of type `T` to convert
    Returns:
      a string representation of the object passed in