public class AttributeGroup extends java.lang.Object implements Binary
Each "attribute-group" field is encoded as follows:
----------------------------------------------- | begin-attribute-group-tag | 1 byte ---------------------------------------------------------- | attribute | p bytes |- 0 or more ----------------------------------------------------------
| Constructor and Description |
|---|
AttributeGroup(AttributeGroup other)
This is the copy construtor.
|
AttributeGroup(java.nio.ByteBuffer bytes)
Instantiates a new attribute group from the given bytes.
|
AttributeGroup(DelimiterTags type)
Instantiates a new empty attribute group from the given bytes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Attribute attr)
Adds an attribute to the given attributes.
|
Attribute |
getAttribute(java.lang.String name)
Looks for the attribute with the given name and returns it.
|
java.util.List<Attribute> |
getAttributes()
An "attribute-group" field contains zero or more "attribute" fields.
|
DelimiterTags |
getBeginTag()
The "begin-attribute-group-tag" field marks the beginning of an
"attribute-group" field and its value identifies the type of
attribute group, e.g.
|
boolean |
hasAttribute(java.lang.String name)
Checks if the given attribute is available.
|
java.lang.String |
toLongString()
All attribute values are put into the resulting string.
|
java.lang.String |
toString()
With this toString() implementation we want to provide the most
important values which are useful for logging and debugging.
|
void |
writeBinaryTo(java.io.OutputStream ostream)
Converts the attribute-group to a byte array as described in RFC-2910 and
writes it to the given output-stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittoByteArraypublic AttributeGroup(AttributeGroup other)
other - AttributeGroup which is copiedpublic AttributeGroup(DelimiterTags type)
type - e.g. DelimiterTags.OPERATION_ATTRIBUTES_TAGpublic AttributeGroup(java.nio.ByteBuffer bytes)
ByteBuffer must be positioned at the beginning of the
attribute-group.bytes - ByteBuffer positioned at the beginningpublic DelimiterTags getBeginTag()
DelimiterTags.OPERATION_ATTRIBUTES_TAGpublic java.util.List<Attribute> getAttributes()
public Attribute getAttribute(java.lang.String name)
IllegalArgumentException will be
thrown.name - of the attributepublic boolean hasAttribute(java.lang.String name)
name - the name of the attributepublic void addAttribute(Attribute attr)
attr - the new attributepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toLongString()
public void writeBinaryTo(java.io.OutputStream ostream)
throws java.io.IOException
----------------------------------------------- | begin-attribute-group-tag | 1 byte ---------------------------------------------------------- | attribute | p bytes |- 0 or more ----------------------------------------------------------
writeBinaryTo in interface Binaryostream - an output streamjava.io.IOException - in case of I/O problemsCopyright © 2018–2020. All rights reserved.