Class ModificationItem

java.lang.Object
javax.naming.directory.ModificationItem
All Implemented Interfaces:
Serializable

public class ModificationItem extends Object implements Serializable
This class represents a modification item. It consists of a modification code and an attribute on which to operate.

A ModificationItem instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single ModificationItem instance should lock the object.

Since:
1.3
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModificationItem(int mod_op, Attribute attr)
    Creates a new instance of ModificationItem.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the attribute associated with this modification item.
    int
    Retrieves the modification code of this modification item.
    Generates the string representation of this modification item, which consists of the modification operation and its related attribute.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Creates and returns a copy of this object.
    boolean
    Indicates whether some other object is "equal to" this one.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Finalization is deprecated and subject to removal in a future release.
    final Class<?>
    Returns the runtime class of this Object.
    int
    Returns a hash code value for this object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    final void
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
    final void
    wait(long timeoutMillis)
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
    final void
    wait(long timeoutMillis, int nanos)
    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
  • Constructor Details

    • ModificationItem

      public ModificationItem(int mod_op, Attribute attr)
      Creates a new instance of ModificationItem.
      Parameters:
      mod_op - Modification to apply. It must be one of: DirContext.ADD_ATTRIBUTE DirContext.REPLACE_ATTRIBUTE DirContext.REMOVE_ATTRIBUTE
      attr - The non-null attribute to use for modification.
      Throws:
      IllegalArgumentException - If attr is null, or if mod_op is not one of the ones specified above.
  • Method Details

    • getModificationOp

      public int getModificationOp()
      Retrieves the modification code of this modification item.
      Returns:
      The modification code. It is one of: DirContext.ADD_ATTRIBUTE DirContext.REPLACE_ATTRIBUTE DirContext.REMOVE_ATTRIBUTE
    • getAttribute

      public Attribute getAttribute()
      Retrieves the attribute associated with this modification item.
      Returns:
      The non-null attribute to use for the modification.
    • toString

      public String toString()
      Generates the string representation of this modification item, which consists of the modification operation and its related attribute. The string representation is meant for debugging and not to be interpreted programmatically.
      Overrides:
      toString in class Object
      Returns:
      The non-null string representation of this modification item.