public final class ServerNames extends Object implements Iterable<ServerName>
| Modifier and Type | Method and Description |
|---|---|
ServerNames |
add(ServerName serverName)
Adds a server name to this list.
|
void |
decode(org.eclipse.californium.elements.util.DatagramReader reader) |
void |
encode(org.eclipse.californium.elements.util.DatagramWriter writer) |
boolean |
equals(Object object) |
byte[] |
get(ServerName.NameType type)
Gets the name value of a server name of a particular type.
|
int |
getEncodedLength()
Gets the number of bytes this server name list is encoded to.
|
ServerName |
getServerName(ServerName.NameType type)
Gets the server name of a particular type.
|
int |
hashCode() |
Iterator<ServerName> |
iterator() |
static ServerNames |
newInstance()
Creates an empty server name list.
|
static ServerNames |
newInstance(ServerName serverName)
Creates a new server name list from an initial server name.
|
static ServerNames |
newInstance(String hostName)
Creates a new server name list from an initial host name.
|
int |
size()
Gets the number of names contained in this list.
|
String |
toString() |
public static ServerNames newInstance()
public static ServerNames newInstance(ServerName serverName)
serverName - The server name to add.public static ServerNames newInstance(String hostName)
hostName - The host name to add as ServerName.NameType.HOST_NAME.public ServerNames add(ServerName serverName)
serverName - The server name to add.public int getEncodedLength()
public int size()
public byte[] get(ServerName.NameType type)
type - The name type.null if no name of the given type is part of the extension.public void encode(org.eclipse.californium.elements.util.DatagramWriter writer)
public void decode(org.eclipse.californium.elements.util.DatagramReader reader)
public ServerName getServerName(ServerName.NameType type)
type - The name type.null if no server name of the given type is part of the extension.public Iterator<ServerName> iterator()
iterator in interface Iterable<ServerName>Copyright © 2023 Eclipse Foundation. All rights reserved.