@NotThreadSafe public abstract static class AbstractAuthenticationRequest.AbstractBuilder<B extends AbstractAuthenticationRequest.AbstractBuilder<B,T>,T extends IAuthenticationRequest> extends Object
IAuthenticationRequest
subtypes.
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.
See Self-bounding generics:
http://www.artima.com/weblogs/viewpost.jsp?thread=136394
http://www.artima.com/forums/flat.jsp?forum=106&thread=136394
http://en.wikipedia.org/wiki/Covariance_and_contravariance
Modifier | Constructor and Description |
---|---|
protected |
AbstractBuilder() |
protected |
AbstractBuilder(AbstractAuthenticationRequest.AbstractBuilder<?,?> copy) |
protected |
AbstractBuilder(IAuthenticationRequest copy) |
Modifier and Type | Method and Description |
---|---|
B |
assertionConsumerServiceURL(String assertionConsumerServiceURL) |
B |
binding(String binding) |
T |
build()
Builds a new
T instance based on this Builder instance (Builder pattern for IAuthenticationRequest ). |
B |
citizenCountryCode(String citizenCountry) |
B |
destination(String destination) |
B |
id(String id) |
B |
issuer(String issuer) |
B |
levelOfAssurance(String levelOfAssurance) |
B |
levelsOfAssurance(List<? extends eu.eidas.auth.commons.light.ILevelOfAssurance> levelsOfAssurance) |
B |
lightRequest(eu.eidas.auth.commons.light.ILightRequest lightRequest) |
B |
nameIdFormat(String nameIdFormat) |
protected abstract T |
newInstance()
Method to be implemented by subtypes to create the right type
T of instances. |
B |
originalIssuer(String originalIssuer) |
B |
originCountryCode(String originCountryCode) |
B |
providerName(String providerName) |
B |
relayState(String relayState) |
B |
requestedAttributes(eu.eidas.auth.commons.attribute.ImmutableAttributeMap requestedAttributes) |
B |
requesterId(String requesterId) |
B |
serviceProviderCountryCode(String spCountry) |
B |
spCountryCode(String spCountryCode) |
B |
spType(String spType) |
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 AbstractAuthenticationRequest.AbstractBuilder<?,?> copy)
protected AbstractBuilder(@Nonnull IAuthenticationRequest copy)
@Nonnull public final B lightRequest(eu.eidas.auth.commons.light.ILightRequest lightRequest)
@Nonnull public final B assertionConsumerServiceURL(String assertionConsumerServiceURL)
@Nonnull public final B requestedAttributes(eu.eidas.auth.commons.attribute.ImmutableAttributeMap requestedAttributes)
@Nonnull public final B levelsOfAssurance(List<? extends eu.eidas.auth.commons.light.ILevelOfAssurance> levelsOfAssurance)
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()
T
instance based on this Builder instance (Builder pattern for IAuthenticationRequest
).
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.