public class Containers extends Object
| 构造器和说明 |
|---|
Containers() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <K> Container<K> |
empty()
Get an empty data source container.
|
static <K> Container<K> |
empty(String namespace)
Create an empty map by given namespace
|
static Container<Object> |
forConstantClass(Class<?> constantClass)
Creates an immutable container from public static constants in the specified class.
|
static Container<Object> |
forConstantClass(Class<?> constantClass,
AnnotationFinder annotationFinder)
Creates an immutable container from public static constants in the specified class.
|
static <K> ImmutableMapContainer<K> |
forEmptyData(String namespace)
Build a data source container based on an input key set
and an expression that returns data sources grouped by key.
|
static <K> Container<K> |
forEnum(Class<? extends Enum<?>> enumType)
Creates an immutable container from a specified enumeration type and a
ContainerEnum annotation. |
static <K> Container<K> |
forEnum(Class<? extends Enum<?>> enumType,
AnnotationFinder annotationFinder,
PropertyOperator propertyOperator)
Creates an immutable container from a specified enumeration type and a
ContainerEnum annotation. |
static <K,T extends Enum<?>> |
forEnum(String namespace,
Class<T> enumType,
Function<? super T,K> keyGetter)
Creates an immutable container from a specified enumeration type and key getter function.
|
static <K> LambdaContainer<K> |
forLambda(String namespace,
DataProvider<K,?> lambda)
Build a data source container based on an input key set
and an expression that returns data sources grouped by key.
|
static <K> ImmutableMapContainer<K> |
forMap(String namespace,
Map<K,?> data)
Create a key-value pair container based on the specified type enumeration.
|
public static <K> Container<K> empty()
Get an empty data source container.
When an assembly operation specifies to use the data source container,
the operation object itself will be used as the data source object.
Container.empty(),
EmptyContainerpublic static <K> Container<K> empty(String namespace)
namespace - namespacepublic static <K> ImmutableMapContainer<K> forMap(String namespace, Map<K,?> data)
Create a key-value pair container based on the specified type enumeration.
The key value is the enumeration attribute value obtained by keyGetter.
K - key typenamespace - namespacedata - data source objects grouped by key valuepublic static <K> ImmutableMapContainer<K> forEmptyData(String namespace)
K - key typenamespace - namespaceDataProvider.empty()public static <K> LambdaContainer<K> forLambda(String namespace, DataProvider<K,?> lambda)
K - key typenamespace - namespacelambda - lambda expressionLambdaContainer.forLambda(String, DataProvider)public static Container<Object> forConstantClass(Class<?> constantClass, AnnotationFinder annotationFinder)
constantClass - the class whose constants should be converted to a containerannotationFinder - used to find annotations in the classConstantContainerBuilderpublic static Container<Object> forConstantClass(Class<?> constantClass)
constantClass - the class whose constants should be converted to a containerConstantContainerBuilderpublic static <K,T extends Enum<?>> Container<K> forEnum(String namespace, Class<T> enumType, Function<? super T,K> keyGetter)
K - key typeT - enumeration typenamespace - namespaceenumType - enum typekeyGetter - method to obtain the corresponding key value from the enumeration instanceEnumContainerBuilderpublic static <K> Container<K> forEnum(Class<? extends Enum<?>> enumType, AnnotationFinder annotationFinder, PropertyOperator propertyOperator)
ContainerEnum annotation.K - key typeenumType - enum typeannotationFinder - annotation finderpropertyOperator - property operatorEnumContainerBuilderpublic static <K> Container<K> forEnum(Class<? extends Enum<?>> enumType)
ContainerEnum annotation.K - key typeenumType - enum typeEnumContainerBuilderCopyright © 2024. All rights reserved.