Package org.forgerock.openidconnect
Class Claim.ClaimBuilder
- java.lang.Object
-
- org.forgerock.oauth.clients.oidc.Claim.ClaimBuilder
-
- org.forgerock.openidconnect.Claim.ClaimBuilder
-
- Enclosing class:
- Claim
public static class Claim.ClaimBuilder extends Claim.ClaimBuilder
Builder to keep theClaim
immutable.
-
-
Constructor Summary
Constructors Constructor Description ClaimBuilder(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Claim
build()
Return the claim this builder was building.Claim.ClaimBuilder
isEssential()
Marks this ClaimBuilder as building an essential claim.Claim.ClaimBuilder
withBooleanValue(Boolean value)
Sets the boolean value for the ClaimBuilder.Claim.ClaimBuilder
withBooleanValues(List<Boolean> values)
Sets the boolean values for the ClaimBuilder.Claim.ClaimBuilder
withJsonValue(JsonValue value)
Sets the value for the ClaimBuilder.Claim.ClaimBuilder
withJsonValues(List<JsonValue> values)
Sets the values for the ClaimBuilder.Claim.ClaimBuilder
withLocale(Locale locale)
Sets the locale of the ClaimBuilder.Claim.ClaimBuilder
withNumericalValue(Number value)
Sets the number value for the ClaimBuilder.Claim.ClaimBuilder
withNumericalValues(List<Number> values)
Sets the number values for the ClaimBuilder.Claim.ClaimBuilder
withStringValue(String value)
Sets the string value for the ClaimBuilder.Claim.ClaimBuilder
withStringValues(List<String> values)
Sets the string values for the ClaimBuilder.
-
-
-
Constructor Detail
-
ClaimBuilder
public ClaimBuilder(String name)
-
-
Method Detail
-
withLocale
public Claim.ClaimBuilder withLocale(Locale locale)
Description copied from class:Claim.ClaimBuilder
Sets the locale of the ClaimBuilder.- Overrides:
withLocale
in classClaim.ClaimBuilder
- Parameters:
locale
- Claim's locale- Returns:
- This builder
-
withStringValues
public Claim.ClaimBuilder withStringValues(List<String> values)
Description copied from class:Claim.ClaimBuilder
Sets the string values for the ClaimBuilder.- Overrides:
withStringValues
in classClaim.ClaimBuilder
- Parameters:
values
- Values to set, must not be null or empty- Returns:
- This builder
-
withNumericalValues
public Claim.ClaimBuilder withNumericalValues(List<Number> values)
Description copied from class:Claim.ClaimBuilder
Sets the number values for the ClaimBuilder.- Overrides:
withNumericalValues
in classClaim.ClaimBuilder
- Parameters:
values
- Values to set, must not be null or empty- Returns:
- This builder
-
withBooleanValues
public Claim.ClaimBuilder withBooleanValues(List<Boolean> values)
Description copied from class:Claim.ClaimBuilder
Sets the boolean values for the ClaimBuilder.- Overrides:
withBooleanValues
in classClaim.ClaimBuilder
- Parameters:
values
- Values to set, must not be null or empty- Returns:
- This builder
-
isEssential
public Claim.ClaimBuilder isEssential()
Description copied from class:Claim.ClaimBuilder
Marks this ClaimBuilder as building an essential claim.- Overrides:
isEssential
in classClaim.ClaimBuilder
- Returns:
- This builder
-
withJsonValue
public Claim.ClaimBuilder withJsonValue(JsonValue value)
Description copied from class:Claim.ClaimBuilder
Sets the value for the ClaimBuilder.- Overrides:
withJsonValue
in classClaim.ClaimBuilder
- Parameters:
value
- The JsonValue to set, must not be null- Returns:
- The builder
-
withJsonValues
public Claim.ClaimBuilder withJsonValues(List<JsonValue> values)
Description copied from class:Claim.ClaimBuilder
Sets the values for the ClaimBuilder.- Overrides:
withJsonValues
in classClaim.ClaimBuilder
- Parameters:
values
- The JsonValue to set, must not be null- Returns:
- The builder
-
withStringValue
public Claim.ClaimBuilder withStringValue(String value)
Description copied from class:Claim.ClaimBuilder
Sets the string value for the ClaimBuilder.- Overrides:
withStringValue
in classClaim.ClaimBuilder
- Parameters:
value
- Value to set, must not be null- Returns:
- This builder
-
withNumericalValue
public Claim.ClaimBuilder withNumericalValue(Number value)
Description copied from class:Claim.ClaimBuilder
Sets the number value for the ClaimBuilder.- Overrides:
withNumericalValue
in classClaim.ClaimBuilder
- Parameters:
value
- Value to set, must not be null- Returns:
- This builder
-
withBooleanValue
public Claim.ClaimBuilder withBooleanValue(Boolean value)
Description copied from class:Claim.ClaimBuilder
Sets the boolean value for the ClaimBuilder.- Overrides:
withBooleanValue
in classClaim.ClaimBuilder
- Parameters:
value
- Value to set, must not be null- Returns:
- This builder
-
build
public Claim build()
Description copied from class:Claim.ClaimBuilder
Return the claim this builder was building.- Overrides:
build
in classClaim.ClaimBuilder
- Returns:
- A claim with the values set in this Builder
-
-