Class 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.
    • Constructor Detail

      • ModifySpec

        public ModifySpec​(String attributeName,
                          com.unboundid.ldap.sdk.ModificationType type)
        Creates an LDAP attribute modification with no value. Intended for ModificationType.DELETE or ModificationType.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 for ModificationType.ADD, ModificationType.DELETE or ModificationType.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 for ModificationType.ADD, ModificationType.DELETE or ModificationType.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 - If true 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 be null.
        binary - If true 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()
        Returns true 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.