K - key typeT - enumeration typepublic class EnumContainerBuilder<K,T extends Enum<?>> extends Object
Containers from enumerations.ContainerEnum| 限定符和类型 | 方法和说明 |
|---|---|
EnumContainerBuilder<K,T> |
annotationFinder(@NonNull AnnotationFinder annotationFinder)
Sets the annotation finder to use for reading the
ContainerEnum annotation. |
Container<K> |
build()
Builds and returns an immutable container from the specified enum type and builder configuration.
|
EnumContainerBuilder<K,T> |
duplicateStrategy(DuplicateStrategy duplicateStrategy)
Set processing strategy of when the key is duplicated.
|
EnumContainerBuilder<K,T> |
enableContainerEnumAnnotation(boolean enableContainerEnumAnnotation)
Whether to enable resolves configuration from the specified
ContainerEnum annotation. |
EnumContainerBuilder<Object,T> |
key(@NonNull String key)
Sets the key to use for obtaining keys from enum values.
|
<K1> EnumContainerBuilder<K1,T> |
keyGetter(@NonNull Function<? super T,K1> keyGetter)
Sets the function to use for obtaining keys from enum values.
|
EnumContainerBuilder<K,T> |
namespace(@Nullable String namespace)
Sets the namespace for the container.
|
static <T extends Enum<?>> |
of(@NonNull Class<T> enumType)
Returns a new builder for the specified enum type.
|
EnumContainerBuilder<K,T> |
propertyOperator(@NonNull PropertyOperator propertyOperator)
Sets the property operator to use for reading properties from enum values.
|
EnumContainerBuilder<K,T> |
value(@NonNull String value)
Sets the value to use for obtaining values from enum values.
|
EnumContainerBuilder<K,T> |
valueGetter(@NonNull Function<? super T,Object> valueGetter)
Sets the function to use for obtaining values from enum values.
|
public static <T extends Enum<?>> EnumContainerBuilder<Object,T> of(@NonNull Class<T> enumType)
T - the type of the enum valuesenumType - the enum type to create a container forpublic EnumContainerBuilder<K,T> namespace(@Nullable String namespace)
namespace - the namespace to setpublic <K1> EnumContainerBuilder<K1,T> keyGetter(@NonNull Function<? super T,K1> keyGetter)
K1 - the type of the keys returned by the key getter functionkeyGetter - the key getter function to setpublic EnumContainerBuilder<Object,T> key(@NonNull String key)
key - the key to setCrane4jException - throw when cannot find key getter of given property from enum typepublic EnumContainerBuilder<K,T> valueGetter(@NonNull Function<? super T,Object> valueGetter)
valueGetter - the value getter function to setpublic EnumContainerBuilder<K,T> value(@NonNull String value)
value - the value to setCrane4jException - throw when cannot find value getter of given property from enum typepublic EnumContainerBuilder<K,T> enableContainerEnumAnnotation(boolean enableContainerEnumAnnotation)
ContainerEnum annotation.enableContainerEnumAnnotation - enable container enum annotationpublic EnumContainerBuilder<K,T> duplicateStrategy(DuplicateStrategy duplicateStrategy)
duplicateStrategy - coverage strategypublic EnumContainerBuilder<K,T> annotationFinder(@NonNull AnnotationFinder annotationFinder)
ContainerEnum annotation.annotationFinder - the annotation finder to setpublic EnumContainerBuilder<K,T> propertyOperator(@NonNull PropertyOperator propertyOperator)
propertyOperator - the property operator to setCopyright © 2024. All rights reserved.