@NotThreadSafe public static final class LevelOfAssurance.Builder extends AbstractLevelOfAssurance.AbstractBuilder<LevelOfAssurance.Builder,LevelOfAssurance>
Builder pattern for the LevelOfAssurance
class.
Effective Java, 2nd Ed. : Item 2: Builder Pattern.
This Builder is not thread-safe but is thread-compliant, it is supposed to be used by only one thread.
Constructor and Description |
---|
Builder() |
Builder(ILevelOfAssurance copy) |
Builder(LevelOfAssurance.Builder copy) |
Modifier and Type | Method and Description |
---|---|
protected LevelOfAssurance |
newInstance()
Method to be implemented by subtypes to create the right type
T of instances. |
protected LevelOfAssurance.Builder |
self()
Typesafe method to avoid casting to obtain subclasses builder instances.
|
build, type, validate, value
public Builder()
public Builder(@Nonnull LevelOfAssurance.Builder copy)
public Builder(@Nonnull ILevelOfAssurance copy)
protected LevelOfAssurance.Builder self()
AbstractLevelOfAssurance.AbstractBuilder
self
in class AbstractLevelOfAssurance.AbstractBuilder<LevelOfAssurance.Builder,LevelOfAssurance>
@Nonnull protected LevelOfAssurance newInstance()
AbstractLevelOfAssurance.AbstractBuilder
Method to be implemented by subtypes to create the right type T
of instances.
The typical implementation simply consists in writing return new MySubType(this);
newInstance
in class AbstractLevelOfAssurance.AbstractBuilder<LevelOfAssurance.Builder,LevelOfAssurance>
T
instance based on this Builder instance.Copyright © 2020. All Rights Reserved.