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

pack-priv final Class IntegerToEnumConverterFactory

extends Object
implements ConverterFactory<Integer, Enum<E extends Enum<E>>>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.ConverterFactory
Annotations
@SuppressWarnings:rawtypes, unchecked
Imports
org.springframework.core.convert.converter.Converter, .ConverterFactory

Converts from an Integer to a java.lang.Enum by calling Class#getEnumConstants().
Authors
Yanming Zhou, Stephane Nicoll
Since
4.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public <T extends Enum<E extends Enum<E>>> Converter<Integer, T>
getConverter(Class<T>
the target type to convert to
targetType
)

Implements org.springframework.core.convert.converter.ConverterFactory.getConverter.

Get the converter to convert from S to target type T, where T is also an instance of R.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IntegerToEnumConverterFactoryback to summary
pack-priv IntegerToEnumConverterFactory()

Method Detail

getConverterback to summary
public <T extends Enum<E extends Enum<E>>> Converter<Integer, T> getConverter(Class<T> targetType)

Implements org.springframework.core.convert.converter.ConverterFactory.getConverter.

Doc from org.springframework.core.convert.converter.ConverterFactory.getConverter.

Get the converter to convert from S to target type T, where T is also an instance of R.

Parameters
<T>
the target type
targetType:Class<T>

the target type to convert to

Returns:Converter<Integer, T>

a converter from S to T

Annotations
@Override
org.springframework.core.convert.support back to summary

private Class IntegerToEnumConverterFactory.IntegerToEnum<T extends Enum<E extends Enum<E>>>

extends Object
implements Converter<Integer, T extends Enum<E extends Enum<E>>>
Class Inheritance
  • java.lang.Object
  • org.springframework.core.convert.support.IntegerToEnumConverterFactory.IntegerToEnum
All Implemented Interfaces
org.springframework.core.convert.converter.Converter

Field Summary

Modifier and TypeField and Description
private final Class<T>

Constructor Summary

AccessConstructor and Description
public
IntegerToEnum(Class<T> enumType)

Method Summary

Modifier and TypeMethod and Description
public T
convert(Integer
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 java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

enumTypeback to summary
private final Class<T> enumType

Constructor Detail

IntegerToEnumback to summary
public IntegerToEnum(Class<T> enumType)

Method Detail

convertback to summary
public T convert(Integer 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:Integer

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

Returns:T

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

Annotations
@Override