Top Description Constructors Methods
org.springframework.core.convert.support

pack-priv final Class EnumToStringConverter

extends AbstractConditionalEnumConverter
implements Converter<Enum<?>, String>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.Converter
Imports
org.springframework.core.convert.ConversionService, org.springframework.core.convert.converter.Converter

Calls Enum#name() to convert a source Enum to a String. This converter will not match enums with interfaces that can be converted.
Authors
Keith Donald, Phillip Webb
Since
3.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
convert(Enum<?>
the source object to convert, which must be an instance of S (never null)
source
)

Implements org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Inherited from org.springframework.core.convert.support.AbstractConditionalEnumConverter:
matches

Constructor Detail

EnumToStringConverterback to summary
public EnumToStringConverter(ConversionService conversionService)

Method Detail

convertback to summary
public String convert(Enum<?> source)

Implements org.springframework.core.convert.converter.Converter.convert.

Doc from org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Parameters
source:Enum<?>

the source object to convert, which must be an instance of S (never null)

Returns:String

the converted object, which must be an instance of T (potentially null)

Annotations
@Override