Class StringToEnumConverterFactory
java.lang.Object
org.springframework.data.couchbase.core.convert.StringToEnumConverterFactory
- All Implemented Interfaces:
ConverterFactory<String,
Enum>
@ReadingConverter
public class StringToEnumConverterFactory
extends Object
implements ConverterFactory<String,Enum>
Reading Converter factory for Enums. This differs from the one provided in org.springframework.core.convert.support
by getting the result from the jackson objectmapper (which will process @JsonValue annotations) This is registered in
AbstractCouchbaseConfiguration.customConversions(CryptoManager, ObjectMapper)
.
This will take precedence over StringToEnumConverterFactory
- Author:
- Michael Reiche
-
Constructor Summary
ConstructorDescriptionStringToEnumConverterFactory
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptiongetConverter
(Class<T> targetType) static Class<?>
getEnumType
(Class<?> targetType)
-
Constructor Details
-
StringToEnumConverterFactory
public StringToEnumConverterFactory(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
getConverter
- Specified by:
getConverter
in interfaceConverterFactory<String,
Enum>
-
getEnumType
-