@NotThreadSafe public static final class LightResponse.Builder extends AbstractLightResponse.AbstractBuilder<LightResponse.Builder,LightResponse>
Builder pattern for the LightResponse
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(ILightResponse copy) |
Builder(LightResponse.Builder copy) |
Modifier and Type | Method and Description |
---|---|
protected LightResponse |
newInstance()
Method to be implemented by subtypes to create the right type
T of instances. |
protected void |
validate()
Validates the state of this Builder before allowing to create new instances of the built type
T . |
attributes, build, consent, id, inResponseToId, ipAddress, issuer, levelOfAssurance, relayState, status, subject, subjectNameIdFormat
public Builder()
public Builder(@Nonnull LightResponse.Builder copy)
public Builder(@Nonnull ILightResponse copy)
protected void validate() throws IllegalArgumentException
AbstractLightResponse.AbstractBuilder
T
.validate
in class AbstractLightResponse.AbstractBuilder<LightResponse.Builder,LightResponse>
IllegalArgumentException
- if the builder is not in a legal state allowing to proceed with the creation
of a T
instance.@Nonnull protected LightResponse newInstance()
AbstractLightResponse.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 AbstractLightResponse.AbstractBuilder<LightResponse.Builder,LightResponse>
T
instance based on this Builder instance.Copyright © 2020. All Rights Reserved.