org.springframework.core.convert.support
Class EnumToStringConverter

java.lang.Object
  extended by org.springframework.core.convert.support.EnumToStringConverter
All Implemented Interfaces:
Converter<java.lang.Enum<?>,java.lang.String>

final class EnumToStringConverter
extends java.lang.Object
implements Converter<java.lang.Enum<?>,java.lang.String>

Simply calls Enum.name() to convert a source Enum to a String.

Since:
3.0
Author:
Keith Donald

Constructor Summary
EnumToStringConverter()
           
 
Method Summary
 java.lang.String convert(java.lang.Enum<?> source)
          Convert the source of type S to target type T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumToStringConverter

EnumToStringConverter()
Method Detail

convert

public java.lang.String convert(java.lang.Enum<?> source)
Description copied from interface: Converter
Convert the source of type S to target type T.

Specified by:
convert in interface Converter<java.lang.Enum<?>,java.lang.String>
Parameters:
source - the source object to convert, which must be an instance of S
Returns:
the converted object, which must be an instance of T