Class StringToByteConverter
- java.lang.Object
-
- com.vaadin.v7.data.util.converter.AbstractStringToNumberConverter<Byte>
-
- com.vaadin.v7.data.util.converter.StringToByteConverter
-
- All Implemented Interfaces:
Converter<String,Byte>
,Serializable
@Deprecated public class StringToByteConverter extends AbstractStringToNumberConverter<Byte>
Deprecated.As of 8.0, a lightweight lambda-based converter can be build withBinder
.forField(...).withConverter(...)
methods.A converter that converts fromString
toByte
and back. Uses the given locale and aNumberFormat
instance for formatting and parsing.Override and overwrite
getFormat(Locale)
to use a different format.- Since:
- 7.4
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.v7.data.util.converter.Converter
Converter.ConversionException
-
-
Constructor Summary
Constructors Constructor Description StringToByteConverter()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Byte
convertToModel(String value, Class<? extends Byte> targetType, Locale locale)
Deprecated.Converts the given value from target type to source type.protected NumberFormat
getFormat(Locale locale)
Deprecated.Returns the format used byAbstractStringToNumberConverter.convertToPresentation(Object, Class, Locale)
andconvertToModel(String, Class, Locale)
.Class<Byte>
getModelType()
Deprecated.The source type of the converter.-
Methods inherited from class com.vaadin.v7.data.util.converter.AbstractStringToNumberConverter
convertToNumber, convertToPresentation, getPresentationType
-
-
-
-
Method Detail
-
getFormat
protected NumberFormat getFormat(Locale locale)
Deprecated.Returns the format used byAbstractStringToNumberConverter.convertToPresentation(Object, Class, Locale)
andconvertToModel(String, Class, Locale)
.- Overrides:
getFormat
in classAbstractStringToNumberConverter<Byte>
- Parameters:
locale
- The locale to use- Returns:
- A NumberFormat instance
-
convertToModel
public Byte convertToModel(String value, Class<? extends Byte> targetType, Locale locale) throws Converter.ConversionException
Deprecated.Description copied from interface:Converter
Converts the given value from target type to source type.A converter can optionally use locale to do the conversion.
A converter should in most cases be symmetric so chainingConverter.convertToPresentation(Object, Class, Locale)
andConverter.convertToModel(Object, Class, Locale)
should return the original value.- Parameters:
value
- The value to convert, compatible with the target type. Can be nulltargetType
- The requested type of the return valuelocale
- The locale to use for conversion. Can be null.- Returns:
- The converted value compatible with the source type
- Throws:
Converter.ConversionException
- If the value could not be converted
-
getModelType
public Class<Byte> getModelType()
Deprecated.Description copied from interface:Converter
The source type of the converter. Values of this type can be passed toConverter.convertToPresentation(Object, Class, Locale)
.- Returns:
- The source type
-
-