fm.liveswitch.TransportAddress Class Reference

An IP address and port. More...

Public Member Functions

boolean equals (Object obj)
 Determines whether the specified object is equal to this instance. More...
 
fm.liveswitch.AddressType getAddressType ()
 Gets the address type. More...
 
String getIPAddress ()
 Gets the IP address. More...
 
int getPort ()
 Gets the port. More...
 
int hashCode ()
 Returns a hash code for this instance. More...
 
void setIPAddress (String value)
 Sets the IP address. More...
 
void setPort (int value)
 Sets the port. More...
 
String toString ()
 Returns a string that represents this instance. More...
 
 TransportAddress (String ipAddress, int port)
 Initializes a new instance of the fm.liveswitch.TransportAddress class. More...
 

Static Public Member Functions

static boolean checkMask (String address1, String address2, String mask)
 Compares two addresses to see if they are on the same subnet. More...
 
static boolean is6To4 (String ipAddress)
 Determines whether the specified IP address is a 6to4 address. More...
 
static boolean isAny (String ipAddress)
 Determines whether the specified IP address is all zeros and represents "any" IP address. More...
 
static boolean isDiscard (String ipAddress)
 Determines whether the specified IP address is a discard address. More...
 
static boolean isDocumentation (String ipAddress)
 Determines whether the specified IP address is a documentation address. More...
 
static boolean isIPAddress (String address)
 Determines whether a string is a valid IPv4 or IPv6 address. More...
 
static boolean isIPv4 (String ipAddress)
 Determines whether the specified IP address is IPv4. More...
 
static boolean isIPv6 (String ipAddress)
 Determines whether the specified IP address is IPv6. More...
 
static boolean isLimitedBroadcast (String ipAddress)
 Determines whether the specified IP address is a limited broadcast address. More...
 
static boolean isLinkLocal (String ipAddress)
 Determines whether the specified IP address is a link-local address. More...
 
static boolean isLoopback (String ipAddress)
 Determines whether the specified IP address is a loopback address. More...
 
static boolean isMulticast (String ipAddress)
 Determines whether the specified IP address is a multicast address. More...
 
static boolean isOrchid (String ipAddress)
 Determines whether the specified IP address is an ORCHID address. More...
 
static boolean isPrivate (String ipAddress)
 Determines whether the specified IP address is a private address. More...
 
static boolean isReserved (String ipAddress)
 Determines whether the specified IP address is a reserved address. More...
 
static boolean isSource (String ipAddress)
 Determines whether the specified IP address is a source address. More...
 
static boolean isTeredo (String ipAddress)
 Determines whether the specified IP address is a Teredo address. More...
 
static String maskFromPrefixLength (int prefixLength)
 Gets a subnet mask from an IPv4 prefix length (0-32). More...
 
static String maskFromPrefixLength (int prefixLength, boolean ipv6)
 Gets a subnet mask from an IPv4 or IPv6 prefix length (0-32 or 0-128). More...
 
static String sanitizeIPAddress (String ipAddress)
 Sanitizes the IP address, removing any local information. More...
 

Detailed Description

An IP address and port.

Constructor & Destructor Documentation

◆ TransportAddress()

fm.liveswitch.TransportAddress.TransportAddress ( String  ipAddress,
int  port 
)

Initializes a new instance of the fm.liveswitch.TransportAddress class.

Parameters
ipAddressThe IP address.
portThe port.

Member Function Documentation

◆ checkMask()

static boolean fm.liveswitch.TransportAddress.checkMask ( String  address1,
String  address2,
String  mask 
)
static

Compares two addresses to see if they are on the same subnet.

Parameters
address1The first address.
address2The second address.
maskThe subnet mask.

◆ equals()

boolean fm.liveswitch.TransportAddress.equals ( Object  obj)

Determines whether the specified object is equal to this instance.

Parameters
objThe object to compare with this instance.

◆ getAddressType()

fm.liveswitch.AddressType fm.liveswitch.TransportAddress.getAddressType ( )

Gets the address type.

◆ getIPAddress()

String fm.liveswitch.TransportAddress.getIPAddress ( )

Gets the IP address.

◆ getPort()

int fm.liveswitch.TransportAddress.getPort ( )

Gets the port.

◆ hashCode()

int fm.liveswitch.TransportAddress.hashCode ( )

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ is6To4()

static boolean fm.liveswitch.TransportAddress.is6To4 ( String  ipAddress)
static

Determines whether the specified IP address is a 6to4 address.

Parameters
ipAddressThe IP address.

◆ isAny()

static boolean fm.liveswitch.TransportAddress.isAny ( String  ipAddress)
static

Determines whether the specified IP address is all zeros and represents "any" IP address.

Parameters
ipAddressThe IP address.

◆ isDiscard()

static boolean fm.liveswitch.TransportAddress.isDiscard ( String  ipAddress)
static

Determines whether the specified IP address is a discard address.

Parameters
ipAddressThe IP address.

◆ isDocumentation()

static boolean fm.liveswitch.TransportAddress.isDocumentation ( String  ipAddress)
static

Determines whether the specified IP address is a documentation address.

Parameters
ipAddressThe IP address.

◆ isIPAddress()

static boolean fm.liveswitch.TransportAddress.isIPAddress ( String  address)
static

Determines whether a string is a valid IPv4 or IPv6 address.

Parameters
addressThe address.

◆ isIPv4()

static boolean fm.liveswitch.TransportAddress.isIPv4 ( String  ipAddress)
static

Determines whether the specified IP address is IPv4.

Parameters
ipAddressThe IP address.
Returns
true
if the specified IP address is IPv4; otherwise,
false
.

◆ isIPv6()

static boolean fm.liveswitch.TransportAddress.isIPv6 ( String  ipAddress)
static

Determines whether the specified IP address is IPv6.

Parameters
ipAddressThe IP address.
Returns
true
if the specified IP address is IPv6; otherwise,
false
.

◆ isLimitedBroadcast()

static boolean fm.liveswitch.TransportAddress.isLimitedBroadcast ( String  ipAddress)
static

Determines whether the specified IP address is a limited broadcast address.

Parameters
ipAddressThe IP address.

◆ isLinkLocal()

static boolean fm.liveswitch.TransportAddress.isLinkLocal ( String  ipAddress)
static

Determines whether the specified IP address is a link-local address.

Parameters
ipAddressThe IP address.

◆ isLoopback()

static boolean fm.liveswitch.TransportAddress.isLoopback ( String  ipAddress)
static

Determines whether the specified IP address is a loopback address.

Parameters
ipAddressThe IP address.

◆ isMulticast()

static boolean fm.liveswitch.TransportAddress.isMulticast ( String  ipAddress)
static

Determines whether the specified IP address is a multicast address.

Parameters
ipAddressThe IP address.

◆ isOrchid()

static boolean fm.liveswitch.TransportAddress.isOrchid ( String  ipAddress)
static

Determines whether the specified IP address is an ORCHID address.

Parameters
ipAddressThe IP address.

◆ isPrivate()

static boolean fm.liveswitch.TransportAddress.isPrivate ( String  ipAddress)
static

Determines whether the specified IP address is a private address.

Parameters
ipAddressThe IP address.

◆ isReserved()

static boolean fm.liveswitch.TransportAddress.isReserved ( String  ipAddress)
static

Determines whether the specified IP address is a reserved address.

Parameters
ipAddressThe IP address.

◆ isSource()

static boolean fm.liveswitch.TransportAddress.isSource ( String  ipAddress)
static

Determines whether the specified IP address is a source address.

Parameters
ipAddressThe IP address.

◆ isTeredo()

static boolean fm.liveswitch.TransportAddress.isTeredo ( String  ipAddress)
static

Determines whether the specified IP address is a Teredo address.

Parameters
ipAddressThe IP address.

◆ maskFromPrefixLength() [1/2]

static String fm.liveswitch.TransportAddress.maskFromPrefixLength ( int  prefixLength)
static

Gets a subnet mask from an IPv4 prefix length (0-32).

Parameters
prefixLengthThe prefix length.

◆ maskFromPrefixLength() [2/2]

static String fm.liveswitch.TransportAddress.maskFromPrefixLength ( int  prefixLength,
boolean  ipv6 
)
static

Gets a subnet mask from an IPv4 or IPv6 prefix length (0-32 or 0-128).

Parameters
prefixLengthThe prefix length.
ipv6Whether to return an IPv6 mask.

◆ sanitizeIPAddress()

static String fm.liveswitch.TransportAddress.sanitizeIPAddress ( String  ipAddress)
static

Sanitizes the IP address, removing any local information.

Parameters
ipAddressThe IP address to sanitize.

◆ setIPAddress()

void fm.liveswitch.TransportAddress.setIPAddress ( String  value)

Sets the IP address.

◆ setPort()

void fm.liveswitch.TransportAddress.setPort ( int  value)

Sets the port.

◆ toString()

String fm.liveswitch.TransportAddress.toString ( )

Returns a string that represents this instance.

Returns
A string that represents this instance.