Package com.nimbusds.ldapsync
Class ModifySpec
- java.lang.Object
-
- com.nimbusds.ldapsync.ModifySpec
-
public final class ModifySpec extends Object
Specifies an LDAP attribute modification. Intended for use in the composition of Json2Ldap "ldap.modify" requests.
-
-
Constructor Summary
Constructors Constructor Description ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type)
Creates an LDAP attribute modification with no value.ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type, String value)
Creates a single-valued non-binary LDAP attribute modification specification.ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type, String value, boolean binary)
Creates a single-valued LDAP attribute modification specification.ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type, List<String> values, boolean binary)
Creates a new generic LDAP attribute modification specification.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAttributeName()
Returns the attribute name.com.unboundid.ldap.sdk.ModificationType
getType()
Returns the modification type.List<String>
getValues()
Returns the modification values.boolean
isBinary()
Returnstrue
if the values are BASE-64 encoded binary values.Map<String,Object>
toJSONObject()
Returns a JSON object representation for inclusion in the Json2Ldap "ldap.modify" -> "mods" parameter.com.unboundid.ldap.sdk.Modification
toModification()
Returns an LDAP SDK modification object.
-
-
-
Constructor Detail
-
ModifySpec
public ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type)
Creates an LDAP attribute modification with no value. Intended forModificationType.DELETE
orModificationType.REPLACE
modifications where all attribute values must be removed.- Parameters:
attributeName
- The name of the attribute.type
- The modification type constant.
-
ModifySpec
public ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type, String value)
Creates a single-valued non-binary LDAP attribute modification specification. Intended forModificationType.ADD
,ModificationType.DELETE
orModificationType.REPLACE
modifications where a single attribute value is affected.- Parameters:
attributeName
- The name of the attribute.type
- The modification type.value
- The modification value.
-
ModifySpec
public ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type, String value, boolean binary)
Creates a single-valued LDAP attribute modification specification. Intended forModificationType.ADD
,ModificationType.DELETE
orModificationType.REPLACE
modifications where a single attribute value is affected.- Parameters:
attributeName
- The name of the attribute.type
- The modification type.value
- The modification value.binary
- Iftrue
the values are BASE-64 encoded binary values.
-
ModifySpec
public ModifySpec(String attributeName, com.unboundid.ldap.sdk.ModificationType type, List<String> values, boolean binary)
Creates a new generic LDAP attribute modification specification.- Parameters:
attributeName
- The name of the attribute.type
- The modification type constant.values
- The modification values, must not benull
.binary
- Iftrue
the values are BASE-64 encoded binary values.
-
-
Method Detail
-
getAttributeName
public String getAttributeName()
Returns the attribute name.- Returns:
- The attribute name.
-
getType
public com.unboundid.ldap.sdk.ModificationType getType()
Returns the modification type.- Returns:
- The modification type.
-
getValues
public List<String> getValues()
Returns the modification values.- Returns:
- The modification values, empty list if none.
-
isBinary
public boolean isBinary()
Returnstrue
if the values are BASE-64 encoded binary values.- Returns:
- The binary flag.
-
toJSONObject
public Map<String,Object> toJSONObject()
Returns a JSON object representation for inclusion in the Json2Ldap "ldap.modify" -> "mods" parameter.- Returns:
- The JSON object representation.
-
toModification
public com.unboundid.ldap.sdk.Modification toModification()
Returns an LDAP SDK modification object.- Returns:
- The modification object.
-
-