Package guru.mikelue.jdut
Class ConductorConfig
- java.lang.Object
-
- guru.mikelue.jdut.ConductorConfig
-
public class ConductorConfig extends Object
Defines the configuration for building block of conduction.
This object supports hierarchy, if the getXXX method cannot found one, try fetch from parent.Building blocks
- The loader of resource
- The
SQLExceptionConvert
- The
operation factory
- The named
operators
- The named
decorations
- The named
JdbcFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ConductorConfig.Builder
This object is fed byConductorConfig.build
throughConsumer
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConductorConfig
build(Consumer<ConductorConfig.Builder> builderConsumer)
Builds configuration withConsumer
of builder.static ConductorConfig
build(Consumer<ConductorConfig.Builder> builderConsumer, ConductorConfig clonedConfig)
Builds configuration withConsumer
of builder and another configuration.protected ConductorConfig
clone()
Optional<DataGrainDecorator>
getDecorator(String name)
Gets decorator by various sources.Optional<JdbcFunction<Connection,?>>
getJdbcFunction(String name)
Gets JDBC function by various sources.Optional<DataGrainOperator>
getOperator(String name)
Gets operator by various sources.Optional<OperatorFactory>
getOperatorFactory()
Gets factory of operator(optional).Optional<Function<String,Reader>>
getResourceLoader()
Gets loader of resource(optional).Optional<SQLExceptionConvert<?>>
getSqlExceptionConvert()
Gets the function for conversion ofSQLException
.Optional<Supplier<?>>
getSupplier(String name)
Gets supplier by various sources.
-
-
-
Method Detail
-
build
public static ConductorConfig build(Consumer<ConductorConfig.Builder> builderConsumer)
Builds configuration withConsumer
of builder.- Parameters:
builderConsumer
- the consumer of builder- Returns:
- The initialized configuration
- See Also:
ConductorConfig.Builder
-
build
public static ConductorConfig build(Consumer<ConductorConfig.Builder> builderConsumer, ConductorConfig clonedConfig)
Builds configuration withConsumer
of builder and another configuration.- Parameters:
builderConsumer
- the consumer of builderclonedConfig
- The cloned configuration- Returns:
- The initialized configuration
- See Also:
ConductorConfig.Builder
-
getResourceLoader
public Optional<Function<String,Reader>> getResourceLoader()
Gets loader of resource(optional).- Returns:
- The loader of resource or parent's one
-
getOperatorFactory
public Optional<OperatorFactory> getOperatorFactory()
Gets factory of operator(optional).- Returns:
- The factory of operators
-
getOperator
public Optional<DataGrainOperator> getOperator(String name)
Gets operator by various sources. Priority of fetching:- Fetches from named operator
- Fetches by operator factory(if provided)
- Fetches from named operator of parent
- Fetches by operator factory of parent(if provided)
- Parameters:
name
- The name of operator- Returns:
- matched operator
-
getDecorator
public Optional<DataGrainDecorator> getDecorator(String name)
Gets decorator by various sources. Priority of fetching:- Fetches from named decorator
- Fetches from named decorator of parent
- Parameters:
name
- The name of decorator- Returns:
- matched decorator
-
getSupplier
public Optional<Supplier<?>> getSupplier(String name)
Gets supplier by various sources. Priority of fetching:- Fetches from named supplier
- Fetches from named supplier of parent
- Parameters:
name
- The name of supplier- Returns:
- matched supplier
-
getJdbcFunction
public Optional<JdbcFunction<Connection,?>> getJdbcFunction(String name)
Gets JDBC function by various sources. Priority of fetching:- Fetches from named JDBC function
- Fetches from named JDBC function of parent
- Parameters:
name
- The name of JDBC function- Returns:
- matched JDBC function
-
getSqlExceptionConvert
public Optional<SQLExceptionConvert<?>> getSqlExceptionConvert()
Gets the function for conversion ofSQLException
.- Returns:
- The optional object of lambda
-
clone
protected ConductorConfig clone()
-
-