- java.lang.Object
-
- org.xnio.channels.SocketAddressBuffer
-
public final class SocketAddressBuffer extends java.lang.Object
A buffer for source and destination addresses.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description SocketAddressBuffer()
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear both addresses in the buffer.java.net.SocketAddress
getDestinationAddress()
Get the destination address.<A extends java.net.SocketAddress>
AgetDestinationAddress(java.lang.Class<A> type)
Get the destination address.java.net.SocketAddress
getSourceAddress()
Get the source address.<A extends java.net.SocketAddress>
AgetSourceAddress(java.lang.Class<A> type)
Get the source address.void
setDestinationAddress(java.net.SocketAddress destinationAddress)
Set the destination address.void
setSourceAddress(java.net.SocketAddress sourceAddress)
Set the source address.
-
-
-
Method Detail
-
getSourceAddress
public java.net.SocketAddress getSourceAddress()
Get the source address.- Returns:
- the source address, or
null
if not set
-
getSourceAddress
public <A extends java.net.SocketAddress> A getSourceAddress(java.lang.Class<A> type)
Get the source address.- Parameters:
type
- the address type to get- Returns:
- the source address, or
null
if not set
-
setSourceAddress
public void setSourceAddress(java.net.SocketAddress sourceAddress)
Set the source address.- Parameters:
sourceAddress
- the source address, ornull
to clear
-
getDestinationAddress
public java.net.SocketAddress getDestinationAddress()
Get the destination address.- Returns:
- the destination address, or
null
if not set
-
getDestinationAddress
public <A extends java.net.SocketAddress> A getDestinationAddress(java.lang.Class<A> type)
Get the destination address.- Parameters:
type
- the address type to get- Returns:
- the destination address, or
null
if not set
-
setDestinationAddress
public void setDestinationAddress(java.net.SocketAddress destinationAddress)
Set the destination address.- Parameters:
destinationAddress
- the destination address, ornull
to clear
-
clear
public void clear()
Clear both addresses in the buffer.
-
-