com.vaadin.flow.data.converter.

Class StringToLongConverter

java.lang.Object
com.vaadin.flow.data.converter.AbstractStringToNumberConverter<Long>
com.vaadin.flow.data.converter.StringToLongConverter

All Implemented Interfaces:

Converter<String,Long>, Serializable

public class StringToLongConverter extends AbstractStringToNumberConverter<Long>

A converter that converts from String to Long and back. Uses the given locale and a NumberFormat instance for formatting and parsing.

Override and overwrite getFormat(Locale) to use a different format.

Since:

1.0

Author:

Vaadin Ltd

See Also:

  • Constructor Details

    • StringToLongConverter

      public StringToLongConverter(String errorMessage)

      Creates a new converter instance with the given error message. Empty strings are converted to null.

      Parameters:

      errorMessage - the error message to use if conversion fails

    • StringToLongConverter

      public StringToLongConverter(Long emptyValue, String errorMessage)

      Creates a new converter instance with the given presentation value for empty string and error message.

      Parameters:

      emptyValue - the presentation value to return when converting an empty string, may be null

      errorMessage - the error message to use if conversion fails

    • StringToLongConverter

      public StringToLongConverter(ErrorMessageProvider errorMessageProvider)

      Creates a new converter instance with the given error message provider. Empty strings are converted to null.

      Parameters:

      errorMessageProvider - the error message provider to use if conversion fails

    • StringToLongConverter

      public StringToLongConverter(Long emptyValue, ErrorMessageProvider errorMessageProvider)

      Creates a new converter instance with the given presentation value for empty string and error message provider.

      Parameters:

      emptyValue - the presentation value to return when converting an empty string, may be null

      errorMessageProvider - the error message provider to use if conversion fails

  • Method Details