public class HostAddresses extends Object implements org.apache.directory.api.asn1.Asn1Object
-- NOTE: HostAddresses is always used as an OPTIONAL field and -- should not be empty. HostAddresses -- NOTE: subtly different from rfc1510, -- but has a value mapping and encodes the same ::= SEQUENCE OF HostAddress
Constructor and Description |
---|
HostAddresses()
Creates a new instance of HostAddresses.
|
HostAddresses(HostAddress[] addresses)
Creates a new instance of HostAddresses.
|
Modifier and Type | Method and Description |
---|---|
void |
addHostAddress(HostAddress hostAddress)
Adds an
HostAddresses to the list |
int |
computeLength()
Compute the hostAddresses length
|
boolean |
contains(HostAddress address)
Returns true if this
HostAddresses contains a specified HostAddress . |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the HostAddress message to a PDU.
|
boolean |
equals(Object obj)
Returns true if two
HostAddresses are equal. |
HostAddress[] |
getAddresses()
Returns the contained
HostAddress s as an array. |
int |
hashCode() |
String |
toString() |
public HostAddresses()
public HostAddresses(HostAddress[] addresses)
addresses
- The associated addressespublic void addHostAddress(HostAddress hostAddress)
HostAddresses
to the listhostAddress
- The address to addpublic boolean contains(HostAddress address)
HostAddresses
contains a specified HostAddress
.address
- The address we are looking for in the existing listHostAddresses
contains a specified HostAddress
.public boolean equals(Object obj)
HostAddresses
are equal.equals
in class Object
obj
- The HostAddresses
we want to compare with the current oneHostAddresses
are equal.public HostAddress[] getAddresses()
HostAddress
s as an array.HostAddress
s.public int computeLength()
HostAddresses : 0x30 L1 hostAddresses sequence of HostAddresses | +--> 0x30 L2[1] Hostaddress[1] | +--> 0x30 L2[2] Hostaddress[2] | ... | +--> 0x30 L2[n] Hostaddress[n] where L1 = sum( L2[1], l2[2], ..., L2[n] )
computeLength
in interface org.apache.directory.api.asn1.Asn1Object
public ByteBuffer encode(ByteBuffer buffer) throws org.apache.directory.api.asn1.EncoderException
HostAddress : 0x30 LL 0x30 LL hostaddress[1] 0x30 LL hostaddress[1] ... 0x30 LL hostaddress[1]
encode
in interface org.apache.directory.api.asn1.Asn1Object
buffer
- The buffer where to put the PDU. It should have been allocated
before, with the right size.org.apache.directory.api.asn1.EncoderException
public String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.