org.opends.server.types
Class RawModification

java.lang.Object
  extended by org.opends.server.types.RawModification
Direct Known Subclasses:
LDAPModification

@PublicAPI(stability=UNCOMMITTED,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public abstract class RawModification
extends java.lang.Object

This class defines the data structures and methods to use when interacting with a raw modification, which describes a change that should be made to an attribute.


Constructor Summary
RawModification()
           
 
Method Summary
static RawModification create(ModificationType modificationType, RawAttribute attribute)
          Creates a new raw modification with the provided type and attribute.
static RawModification create(ModificationType modificationType, java.lang.String attributeType)
          Creates a new raw modification with the provided type and attribute.
static RawModification create(ModificationType modificationType, java.lang.String attributeType, ByteString attributeValue)
          Creates a new raw modification with the provided type and attribute.
static RawModification create(ModificationType modificationType, java.lang.String attributeType, java.util.List<ByteString> attributeValues)
          Creates a new raw modification with the provided type and attribute.
static RawModification create(ModificationType modificationType, java.lang.String attributeType, java.lang.String attributeValue)
          Creates a new raw modification with the provided type and attribute.
static LDAPModification decode(ASN1Element element)
          Decodes the provided ASN.1 element as an LDAP modification.
 ASN1Element encode()
          Encodes this modification to an ASN.1 element.
abstract  RawAttribute getAttribute()
          Retrieves the attribute for this modification.
abstract  ModificationType getModificationType()
          Retrieves the modification type for this modification.
abstract  void setAttribute(RawAttribute attribute)
          Specifies the attribute for this modification.
abstract  void setModificationType(ModificationType modificationType)
          Specifies the modification type for this modification.
abstract  Modification toModification()
          Creates a new core Modification object from this raw modification.
 java.lang.String toString()
          Retrieves a string representation of this modification.
abstract  void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this modification to the provided buffer.
abstract  void toString(java.lang.StringBuilder buffer, int indent)
          Appends a multi-line string representation of this LDAP modification to the provided buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RawModification

public RawModification()
Method Detail

create

public static RawModification create(ModificationType modificationType,
                                     RawAttribute attribute)
Creates a new raw modification with the provided type and attribute.

Parameters:
modificationType - The modification type for this modification.
attribute - The attribute for this modification.
Returns:
The constructed raw modification.

create

public static RawModification create(ModificationType modificationType,
                                     java.lang.String attributeType)
Creates a new raw modification with the provided type and attribute.

Parameters:
modificationType - The modification type for this modification.
attributeType - The name of the attribute type for this modification.
Returns:
The constructed raw modification.

create

public static RawModification create(ModificationType modificationType,
                                     java.lang.String attributeType,
                                     java.lang.String attributeValue)
Creates a new raw modification with the provided type and attribute.

Parameters:
modificationType - The modification type for this modification.
attributeType - The name of the attribute type for this modification.
attributeValue - The attribute value for this modification.
Returns:
The constructed raw modification.

create

public static RawModification create(ModificationType modificationType,
                                     java.lang.String attributeType,
                                     ByteString attributeValue)
Creates a new raw modification with the provided type and attribute.

Parameters:
modificationType - The modification type for this modification.
attributeType - The name of the attribute type for this modification.
attributeValue - The attribute value for this modification.
Returns:
The constructed raw modification.

create

public static RawModification create(ModificationType modificationType,
                                     java.lang.String attributeType,
                                     java.util.List<ByteString> attributeValues)
Creates a new raw modification with the provided type and attribute.

Parameters:
modificationType - The modification type for this modification.
attributeType - The name of the attribute type for this modification.
attributeValues - The set of attribute values for this modification.
Returns:
The constructed raw modification.

getModificationType

public abstract ModificationType getModificationType()
Retrieves the modification type for this modification.

Returns:
The modification type for this modification.

setModificationType

public abstract void setModificationType(ModificationType modificationType)
Specifies the modification type for this modification.

Parameters:
modificationType - The modification type for this modification.

getAttribute

public abstract RawAttribute getAttribute()
Retrieves the attribute for this modification.

Returns:
The attribute for this modification.

setAttribute

public abstract void setAttribute(RawAttribute attribute)
Specifies the attribute for this modification.

Parameters:
attribute - The attribute for this modification.

encode

public final ASN1Element encode()
Encodes this modification to an ASN.1 element.

Returns:
The ASN.1 element containing the encoded modification.

decode

public static LDAPModification decode(ASN1Element element)
                               throws LDAPException
Decodes the provided ASN.1 element as an LDAP modification.

Parameters:
element - The ASN.1 element to decode.
Returns:
The decoded LDAP modification.
Throws:
LDAPException - If a problem occurs while attempting to decode the provided ASN.1 element as a raw modification.

toModification

public abstract Modification toModification()
                                     throws LDAPException
Creates a new core Modification object from this raw modification.

Returns:
The decoded modification.
Throws:
LDAPException - If a problem occurs while trying to convert the raw modification to a core Modification.

toString

public java.lang.String toString()
Retrieves a string representation of this modification.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this modification.

toString

public abstract void toString(java.lang.StringBuilder buffer)
Appends a string representation of this modification to the provided buffer.

Parameters:
buffer - The buffer to which the information should be appended.

toString

public abstract void toString(java.lang.StringBuilder buffer,
                              int indent)
Appends a multi-line string representation of this LDAP modification to the provided buffer.

Parameters:
buffer - The buffer to which the information should be appended.
indent - The number of spaces from the margin that the lines should be indented.