public final class DiscoverableEnums<T extends Enum<T> & DiscoverableEnum<T>> extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Class<?> type,
String text)
for validator.
|
T |
convert(Object source)
for String2DiscoverableEnumConverter.
|
Object |
convert(Object source,
org.springframework.core.convert.TypeDescriptor targetType)
for String2DiscoverableEnumConverter.
|
static <T extends Enum<T> & DiscoverableEnum<T>> |
discoverableEnums(String basePackage,
Class<?> type)
scan.
|
Optional<T> |
parse(Class<T> targetType,
String source)
parse enum.
|
public boolean contains(Class<?> type, String text)
type
- typetext
- textpublic T convert(Object source)
source
- text or namepublic Object convert(Object source, org.springframework.core.convert.TypeDescriptor targetType)
source
- text or nametargetType
- targetTypepublic Optional<T> parse(Class<T> targetType, String source)
targetType
- targetTypesource
- text or namepublic static <T extends Enum<T> & DiscoverableEnum<T>> DiscoverableEnums<T> discoverableEnums(String basePackage, Class<?> type)
T
- enum typebasePackage
- base packagetype
- type to findCopyright © 2017. All rights reserved.