Package com.unboundid.ldap.sdk
Class ModificationType
- java.lang.Object
-
- com.unboundid.ldap.sdk.ModificationType
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ModificationType extends java.lang.Object implements java.io.Serializable
This class defines a data type for modification type values. Clients should generally use one of theADD
,DELETE
,REPLACE
, orINCREMENT
values, although it is possible to create a new modification type with a specified integer value if necessary using thevalueOf(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 theADD
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static 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.static int
ADD_INT_VALUE
The integer value for the "add" modification type.static ModificationType
DELETE
A predefined delete modification type, which indicates that the specified attribute or attribute values should be removed from the entry.static int
DELETE_INT_VALUE
The integer value for the "delete" modification type.static ModificationType
INCREMENT
A predefined increment modification type, which indicates that the value of the specified attribute should be incremented.static int
INCREMENT_INT_VALUE
The integer value for the "increment" modification type.static 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).static int
REPLACE_INT_VALUE
The integer value for the "replace" modification type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ModificationType
definedValueOf(int intValue)
Retrieves the predefined modification type with the specified integer value.boolean
equals(java.lang.Object o)
Indicates whether the provided object is equal to this modification type.java.lang.String
getName()
Retrieves the name for this modification type.int
hashCode()
The hash code for this modification type.int
intValue()
Retrieves the integer value for this modification type.java.lang.String
toString()
Retrieves a string representation of this modification type.static ModificationType
valueOf(int intValue)
Retrieves the modification type with the specified integer value.static ModificationType[]
values()
Retrieves an array of all modification types defined in the LDAP SDK.
-
-
-
Field Detail
-
ADD_INT_VALUE
public static final int ADD_INT_VALUE
The integer value for the "add" modification type.- See Also:
- Constant Field Values
-
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 theADD
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
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 Detail
-
getName
@NotNull public java.lang.String 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 classjava.lang.Object
- Returns:
- The hash code for this modification type.
-
equals
public boolean equals(@Nullable java.lang.Object o)
Indicates whether the provided object is equal to this modification type.- Overrides:
equals
in classjava.lang.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, orfalse
if not.
-
-