Class ModificationType

java.lang.Object
com.unboundid.ldap.sdk.ModificationType
All Implemented Interfaces:
Serializable

This class defines a data type for modification type values. Clients should generally use one of the ADD, DELETE, REPLACE, or INCREMENT values, although it is possible to create a new modification type with a specified integer value if necessary using the valueOf(int) method. The following modification types are defined:
  • ADD -- Indicates that the provided value(s) should be added to the specified attribute in the target entry. If the attribute does not already exist, it will be created. If it does exist, then the new values will be merged added to the existing values. At least one value must be provided with the ADD modification type, and none of those values will be allowed to exist in the entry.
  • DELETE -- Indicates that the specified attribute or attribute values should be removed from the entry. If no values are provided, then the entire attribute will be removed. If one or more values are given, then only those values will be removed. If any values are provided, then all of those values must exist in the target entry.
  • REPLACE -- Indicates that the set of values for the specified attribute should be replaced with the provided value(s). If no values are given, then the specified attribute will be removed from the entry if it exists, or no change will be made. If one or more values are provided, then those values will replace the existing values if the attribute already exists, or a new attribute will be added with those values if there was previously no such attribute in the entry.
  • INCREMENT -- Indicates that the value of the specified attribute should be incremented. The target entry must have exactly one value for the specified attribute and it must be an integer. The modification must include exactly one value, and it must be an integer which specifies the amount by which the existing value is to be incremented (or decremented, if the provided value is negative).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ModificationType
    A predefined add modification type, which indicates that the associated value(s) should be added to the specified attribute in the target entry.
    static final int
    The integer value for the "add" modification type.
    static final ModificationType
    A predefined delete modification type, which indicates that the specified attribute or attribute values should be removed from the entry.
    static final int
    The integer value for the "delete" modification type.
    static final ModificationType
    A predefined increment modification type, which indicates that the value of the specified attribute should be incremented.
    static final int
    The integer value for the "increment" modification type.
    static final ModificationType
    A predefined replace modification type, which indicates that the set of values for the specified attribute should be replaced with the provided value(s).
    static final int
    The integer value for the "replace" modification type.
  • Method Summary

    Modifier and Type
    Method
    Description
    definedValueOf(int intValue)
    Retrieves the predefined modification type with the specified integer value.
    boolean
    Indicates whether the provided object is equal to this modification type.
    Retrieves the name for this modification type.
    int
    The hash code for this modification type.
    int
    Retrieves the integer value for this modification type.
    Retrieves a string representation of this modification type.
    valueOf(int intValue)
    Retrieves the modification type with the specified integer value.
    Retrieves an array of all modification types defined in the LDAP SDK.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ADD_INT_VALUE

      public static final int ADD_INT_VALUE
      The integer value for the "add" modification type.
      See Also:
    • ADD

      @NotNull public static final ModificationType ADD
      A predefined add modification type, which indicates that the associated value(s) should be added to the specified attribute in the target entry. If the attribute does not already exist, it will be created. If it does exist, then the new values will be merged added to the existing values. At least one value must be provided with the ADD modification type, and none of those values will be allowed to exist in the entry.
    • DELETE_INT_VALUE

      public static final int DELETE_INT_VALUE
      The integer value for the "delete" modification type.
      See Also:
    • DELETE

      @NotNull public static final ModificationType DELETE
      A predefined delete modification type, which indicates that the specified attribute or attribute values should be removed from the entry. If no values are provided, then the entire attribute will be removed. If one or more values are given, then only those values will be removed. If any values are provided, then all of those values must exist in the target entry.
    • REPLACE_INT_VALUE

      public static final int REPLACE_INT_VALUE
      The integer value for the "replace" modification type.
      See Also:
    • REPLACE

      @NotNull public static final ModificationType REPLACE
      A predefined replace modification type, which indicates that the set of values for the specified attribute should be replaced with the provided value(s). If no values are given, then the specified attribute will be removed from the entry if it exists, or no change will be made. If one or more values are provided, then those values will replace the existing values if the attribute already exists, or a new attribute will be added with those values if there was previously no such attribute in the entry.
    • INCREMENT_INT_VALUE

      public static final int INCREMENT_INT_VALUE
      The integer value for the "increment" modification type.
      See Also:
    • INCREMENT

      @NotNull public static final ModificationType INCREMENT
      A predefined increment modification type, which indicates that the value of the specified attribute should be incremented. The target entry must have exactly one value for the specified attribute and it must be an integer. The modification must include exactly one value, and it must be an integer which specifies the amount by which the existing value is to be incremented (or decremented, if the provided value is negative).
  • Method Details

    • getName

      Retrieves the name for this modification type.
      Returns:
      The name for this modification type.
    • intValue

      public int intValue()
      Retrieves the integer value for this modification type.
      Returns:
      The integer value for this modification type.
    • valueOf

      @NotNull public static ModificationType valueOf(int intValue)
      Retrieves the modification type with the specified integer value.
      Parameters:
      intValue - The integer value for which to retrieve the corresponding modification type.
      Returns:
      The modification type with the specified integer value, or a new modification type if the provided value does not match any of the predefined modification types.
    • definedValueOf

      @Nullable public static ModificationType definedValueOf(int intValue)
      Retrieves the predefined modification type with the specified integer value.
      Parameters:
      intValue - The integer value for which to retrieve the corresponding modification type.
      Returns:
      The modification type with the specified integer value, or null if the provided integer value does not represent a defined modification type.
    • values

      @NotNull public static ModificationType[] values()
      Retrieves an array of all modification types defined in the LDAP SDK.
      Returns:
      An array of all modification types defined in the LDAP SDK.
    • hashCode

      public int hashCode()
      The hash code for this modification type.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code for this modification type.
    • equals

      public boolean equals(@Nullable Object o)
      Indicates whether the provided object is equal to this modification type.
      Overrides:
      equals in class Object
      Parameters:
      o - The object for which to make the determination.
      Returns:
      true if the provided object is a modification type that is equal to this modification type, or false if not.
    • toString

      Retrieves a string representation of this modification type.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this modification type.