Package org.xnio.channels
Class SocketAddressBuffer
java.lang.Object
org.xnio.channels.SocketAddressBuffer
A buffer for source and destination addresses.
- Author:
- David M. Lloyd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear both addresses in the buffer.Get the destination address.<A extends SocketAddress>
AgetDestinationAddress(Class<A> type) Get the destination address.Get the source address.<A extends SocketAddress>
AgetSourceAddress(Class<A> type) Get the source address.voidsetDestinationAddress(SocketAddress destinationAddress) Set the destination address.voidsetSourceAddress(SocketAddress sourceAddress) Set the source address.
-
Constructor Details
-
SocketAddressBuffer
public SocketAddressBuffer()Construct a new instance.
-
-
Method Details
-
getSourceAddress
Get the source address.- Returns:
- the source address, or
nullif not set
-
getSourceAddress
Get the source address.- Parameters:
type- the address type to get- Returns:
- the source address, or
nullif not set
-
setSourceAddress
Set the source address.- Parameters:
sourceAddress- the source address, ornullto clear
-
getDestinationAddress
Get the destination address.- Returns:
- the destination address, or
nullif not set
-
getDestinationAddress
Get the destination address.- Parameters:
type- the address type to get- Returns:
- the destination address, or
nullif not set
-
setDestinationAddress
Set the destination address.- Parameters:
destinationAddress- the destination address, ornullto clear
-
clear
public void clear()Clear both addresses in the buffer.
-