@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class Modification extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
Modification(ModificationType modificationType,
java.lang.String attributeName)
Creates a new LDAP modification with the provided modification type and
attribute name.
|
Modification(ModificationType modificationType,
java.lang.String attributeName,
ASN1OctetString[] attributeValues)
Creates a new LDAP modification with the provided information.
|
Modification(ModificationType modificationType,
java.lang.String attributeName,
byte[]... attributeValues)
Creates a new LDAP modification with the provided information.
|
Modification(ModificationType modificationType,
java.lang.String attributeName,
byte[] attributeValue)
Creates a new LDAP modification with the provided information.
|
Modification(ModificationType modificationType,
java.lang.String attributeName,
java.lang.String... attributeValues)
Creates a new LDAP modification with the provided information.
|
Modification(ModificationType modificationType,
java.lang.String attributeName,
java.lang.String attributeValue)
Creates a new LDAP modification with the provided information.
|
Modifier and Type | Method and Description |
---|---|
static Modification |
decode(ASN1Sequence modificationSequence)
Decodes the provided ASN.1 sequence as an LDAP modification.
|
ASN1Sequence |
encode()
Encodes this modification to an ASN.1 sequence suitable for use in the LDAP
protocol.
|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this LDAP modification.
|
Attribute |
getAttribute()
Retrieves the attribute for this modification.
|
java.lang.String |
getAttributeName()
Retrieves the name of the attribute to target with this modification.
|
ModificationType |
getModificationType()
Retrieves the modification type for this modification.
|
ASN1OctetString[] |
getRawValues()
Retrieves the set of values for this modification as an array of ASN.1
octet strings.
|
byte[][] |
getValueByteArrays()
Retrieves the set of values for this modification as an array of byte
arrays.
|
java.lang.String[] |
getValues()
Retrieves the set of values for this modification as an array of strings.
|
int |
hashCode()
Calculates a hash code for this LDAP modification.
|
boolean |
hasValue()
Indicates whether this modification has at least one value.
|
static Modification |
readFrom(ASN1StreamReader reader)
Reads and decodes an LDAP modification from the provided ASN.1 stream
reader.
|
void |
toCode(java.util.List<java.lang.String> lineList,
int indentSpaces,
java.lang.String firstLinePrefix,
java.lang.String lastLineSuffix)
Appends a number of lines comprising the Java source code that can be used
to recreate this modification to the given list.
|
java.lang.String |
toString()
Retrieves a string representation of this LDAP modification.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP modification to the provided
buffer.
|
void |
writeTo(ASN1Buffer buffer)
Writes an ASN.1-encoded representation of this modification to the provided
ASN.1 buffer.
|
public Modification(@NotNull ModificationType modificationType, @NotNull java.lang.String attributeName)
modificationType
- The modification type for this modification.attributeName
- The name of the attribute to target with this
modification. It must not be null
.public Modification(@NotNull ModificationType modificationType, @NotNull java.lang.String attributeName, @NotNull java.lang.String attributeValue)
modificationType
- The modification type for this modification.attributeName
- The name of the attribute to target with this
modification. It must not be null
.attributeValue
- The attribute value for this modification. It
must not be null
.public Modification(@NotNull ModificationType modificationType, @NotNull java.lang.String attributeName, @NotNull byte[] attributeValue)
modificationType
- The modification type for this modification.attributeName
- The name of the attribute to target with this
modification. It must not be null
.attributeValue
- The attribute value for this modification. It
must not be null
.public Modification(@NotNull ModificationType modificationType, @NotNull java.lang.String attributeName, @NotNull java.lang.String... attributeValues)
modificationType
- The modification type for this modification.attributeName
- The name of the attribute to target with this
modification. It must not be null
.attributeValues
- The set of attribute value for this modification.
It must not be null
.public Modification(@NotNull ModificationType modificationType, @NotNull java.lang.String attributeName, @NotNull byte[]... attributeValues)
modificationType
- The modification type for this modification.attributeName
- The name of the attribute to target with this
modification. It must not be null
.attributeValues
- The set of attribute value for this modification.
It must not be null
.public Modification(@NotNull ModificationType modificationType, @NotNull java.lang.String attributeName, @NotNull ASN1OctetString[] attributeValues)
modificationType
- The modification type for this modification.attributeName
- The name of the attribute to target with this
modification. It must not be null
.attributeValues
- The set of attribute value for this modification.
It must not be null
.@NotNull public ModificationType getModificationType()
@NotNull public Attribute getAttribute()
@NotNull public java.lang.String getAttributeName()
public boolean hasValue()
true
if this modification has one or more values, or
false
if not.@NotNull public java.lang.String[] getValues()
@NotNull public byte[][] getValueByteArrays()
@NotNull public ASN1OctetString[] getRawValues()
public void writeTo(@NotNull ASN1Buffer buffer)
buffer
- The ASN.1 buffer to which the encoded representation should
be written.@NotNull public ASN1Sequence encode()
@NotNull public static Modification readFrom(@NotNull ASN1StreamReader reader) throws LDAPException
reader
- The ASN.1 stream reader from which to read the
modification.LDAPException
- If a problem occurs while trying to read or decode
the modification.@NotNull public static Modification decode(@NotNull ASN1Sequence modificationSequence) throws LDAPException
modificationSequence
- The ASN.1 sequence to decode as an LDAP
modification. It must not be null
.LDAPException
- If a problem occurs while trying to decode the
provided ASN.1 sequence as an LDAP modification.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object o)
equals
in class java.lang.Object
o
- The object for which to make the determination.true
if the provided object is equal to this modification,
or false
if not.@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public void toString(@NotNull java.lang.StringBuilder buffer)
buffer
- The buffer to which to append the string representation of
this LDAP modification.public void toCode(@NotNull java.util.List<java.lang.String> lineList, int indentSpaces, @Nullable java.lang.String firstLinePrefix, @Nullable java.lang.String lastLineSuffix)
lineList
- The list to which the source code lines should be
added.indentSpaces
- The number of spaces that should be used to indent
the generated code. It must not be negative.firstLinePrefix
- An optional string that should precede
"new Modification(" on the first line of the
generated code (e.g., it could be used for an
attribute assignment, like "Modification m = ").
It may be null
or empty if there should be
no first line prefix.lastLineSuffix
- An optional suffix that should follow the closing
parenthesis of the constructor (e.g., it could be
a semicolon to represent the end of a Java
statement or a comma to separate it from another
element in an array). It may be null
or
empty if there should be no last line suffix.