类 AbstractConfigurer<O,B extends Builder<O>>
- java.lang.Object
-
- cn.sliew.milky.dsl.AbstractConfigurer<O,B>
-
- 类型参数:
O- The Object being built by BB- The Builder that is building O and is configured byAbstractConfigurer
- 所有已实现的接口:
Configurer<O,B>
public abstract class AbstractConfigurer<O,B extends Builder<O>> extends Object implements Configurer<O,B>
A base class forConfigurerthat allows subclasses to only implement the methods they are interested in. It also provides a mechanism for using theConfigurerand when done gaining access to theBuilderthat is being configured.
-
-
构造器概要
构造器 构造器 说明 AbstractConfigurer()
-
-
-
方法详细资料
-
init
public void init(B builder) throws Exception
从接口复制的说明:ConfigurerInitialize theBuilder. Here only shared state should be created and modified, but not properties on theBuilderused for building the object. This ensures that theConfigurer.configure(Builder)method uses the correct shared objects when building. Configurers should be applied here.
-
configure
public void configure(B builder) throws Exception
从接口复制的说明:Configurer
-
and
public B and()
Return theBuilderwhen done using theConfigurer. This is useful for method chaining.- 返回:
- the
Builderfor further customizations
-
getBuilder
protected final B getBuilder()
Gets theBuilder. Cannot be null.- 返回:
- the
Builder - 抛出:
IllegalStateException- ifBuilderis null
-
setBuilder
public void setBuilder(B builder)
Sets theBuilderto be used. This is automatically set when usingAbstractConfiguredBuilder.apply(AbstractConfigurer)- 参数:
builder- theBuilderto set
-
-