B
- the type of the Builder itselfT
- the type being built by the build()
method of this builder.@NotThreadSafe public abstract static class AbstractLightToken.AbstractBuilder<B extends AbstractLightToken.AbstractBuilder<B,T>,T extends ILightToken> extends Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractBuilder() |
protected |
AbstractBuilder(AbstractLightToken.AbstractBuilder<?,?> copy) |
protected |
AbstractBuilder(ILightToken copy) |
Modifier and Type | Method and Description |
---|---|
T |
build()
Builds a new
T instance based on this Builder instance (Builder pattern for ILightToken ). |
B |
createdOn(org.joda.time.DateTime createdOn) |
B |
id(String id) |
B |
issuer(String issuer) |
protected abstract T |
newInstance()
Method to be implemented by subtypes to create the right type
T of instances. |
protected abstract void |
validate()
Validates the state of this Builder before allowing to create new instances of the built type
T . |
protected AbstractBuilder()
protected AbstractBuilder(@Nonnull AbstractLightToken.AbstractBuilder<?,?> copy)
protected AbstractBuilder(@Nonnull ILightToken copy)
protected abstract void validate() throws IllegalArgumentException
T
.IllegalArgumentException
- if the builder is not in a legal state allowing to proceed with the creation
of a T
instance.@Nonnull public final T build()
Builds a new T
instance based on this Builder instance (Builder pattern for ILightToken
).
The validate()
is always called before creating a new instance through a call to the newInstance()
method.
T
instance based on this Builder instance.Copyright © 2020. All Rights Reserved.