Class AddOperation
- java.lang.Object
-
- com.nimbusds.openid.connect.sdk.federation.policy.operations.AddOperation
-
- All Implemented Interfaces:
PolicyConfiguration
,PolicyOperation
,StringConfiguration
,StringListConfiguration
,StringListOperation
public class AddOperation extends Object implements StringConfiguration, StringListOperation
Add (add) operation.Example policy:
"contacts" : { "add" : "[email protected]" }
Input:
"contacts" : "[email protected]"
Result:
"contacts" : [ "[email protected]", "[email protected]" ]
Related specifications:
- OpenID Connect Federation 1.0, section 5.1.2.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.nimbusds.openid.connect.sdk.federation.policy.operations.ConfigurationType
configType
The configuration type.static OperationName
NAME
protected Set<String>
setConfig
The set configuration.
-
Constructor Summary
Constructors Constructor Description AddOperation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
apply(List<String> value)
Applies a string list operation.void
configure(String parameter)
Configure.void
configure(List<String> parameter)
Configures.OperationName
getOperationName()
Returns the name identifying the policy operation.String
getStringConfiguration()
Gets the string configuration.List<String>
getStringListConfiguration()
Gets the string list configuration.PolicyOperation
merge(PolicyOperation other)
Merges a policy operation.void
parseConfiguration(Object jsonEntity)
Parses a federation policy operation configuration from the specified JSON entity.Map.Entry<String,Object>
toJSONObjectEntry()
Returns a JSON object entry representation of the policy operation.
-
-
-
Field Detail
-
NAME
public static final OperationName NAME
-
configType
protected com.nimbusds.openid.connect.sdk.federation.policy.operations.ConfigurationType configType
The configuration type.
-
-
Constructor Detail
-
AddOperation
public AddOperation()
-
-
Method Detail
-
getOperationName
public OperationName getOperationName()
Description copied from interface:PolicyOperation
Returns the name identifying the policy operation.- Specified by:
getOperationName
in interfacePolicyOperation
- Returns:
- The operation name.
-
configure
public void configure(String parameter)
Description copied from interface:StringConfiguration
Configure.- Specified by:
configure
in interfaceStringConfiguration
- Parameters:
parameter
- The string configuration parameter. Must not benull
.
-
parseConfiguration
public void parseConfiguration(Object jsonEntity) throws ParseException
Description copied from interface:PolicyOperation
Parses a federation policy operation configuration from the specified JSON entity.- Specified by:
parseConfiguration
in interfacePolicyOperation
- Parameters:
jsonEntity
- The JSON entity, must represent a boolean, number, string, array or object.null
if not specified.- Throws:
ParseException
- On a parse exception.
-
toJSONObjectEntry
public Map.Entry<String,Object> toJSONObjectEntry()
Description copied from interface:PolicyOperation
Returns a JSON object entry representation of the policy operation.- Specified by:
toJSONObjectEntry
in interfacePolicyOperation
- Returns:
- The JSON object entry, with a boolean, number, string, array or object value.
-
getStringConfiguration
public String getStringConfiguration()
Description copied from interface:StringConfiguration
Gets the string configuration.- Specified by:
getStringConfiguration
in interfaceStringConfiguration
- Returns:
- The string configuration parameter.
-
merge
public PolicyOperation merge(PolicyOperation other) throws PolicyViolationException
Description copied from interface:PolicyOperation
Merges a policy operation.- Specified by:
merge
in interfacePolicyOperation
- Parameters:
other
- The policy to merge. Must be of the same type and notnull
.- Returns:
- The resulting new policy operation.
- Throws:
PolicyViolationException
- On a merge exception.
-
apply
public List<String> apply(List<String> value)
Description copied from interface:StringListOperation
Applies a string list operation.- Specified by:
apply
in interfaceStringListOperation
- Parameters:
value
- The string list,null
if not specified.- Returns:
- The resulting string list (unmodifiable).
-
configure
public void configure(List<String> parameter)
Description copied from interface:StringListConfiguration
Configures.- Specified by:
configure
in interfaceStringListConfiguration
- Parameters:
parameter
- The string list configuration parameter. Must not benull
.
-
getStringListConfiguration
public List<String> getStringListConfiguration()
Description copied from interface:StringListConfiguration
Gets the string list configuration.- Specified by:
getStringListConfiguration
in interfaceStringListConfiguration
- Returns:
- The string list configuration parameter.
-
-