fm.liveswitch.IPNetwork Class Reference

An IP network. More...

Public Member Functions

String getAddress ()
 Gets the address. More...
 
String getMask ()
 Gets the mask. More...
 
int getPrefixLength ()
 Gets the prefix length. More...
 
boolean matches (String address)
 Checks if an address exists in this network. More...
 
String toString ()
 Returns a string that represents this instance. More...
 

Static Public Member Functions

static fm.liveswitch.IPNetwork parse (String cidr)
 Parses a CIDR. More...
 
static boolean tryParse (String cidr, fm.liveswitch.Holder< fm.liveswitch.IPNetwork > network)
 Tries to parse a CIDR. More...
 

Detailed Description

An IP network.

Member Function Documentation

◆ getAddress()

String fm.liveswitch.IPNetwork.getAddress ( )

Gets the address.

◆ getMask()

String fm.liveswitch.IPNetwork.getMask ( )

Gets the mask.

◆ getPrefixLength()

int fm.liveswitch.IPNetwork.getPrefixLength ( )

Gets the prefix length.

◆ matches()

boolean fm.liveswitch.IPNetwork.matches ( String  address)

Checks if an address exists in this network.

Parameters
addressThe address.
Returns
true
if the address exists in this network; otherwise,
false
.

◆ parse()

static fm.liveswitch.IPNetwork fm.liveswitch.IPNetwork.parse ( String  cidr)
static

Parses a CIDR.

Parameters
cidrThe CIDR.
Returns
The IP network.

◆ toString()

String fm.liveswitch.IPNetwork.toString ( )

Returns a string that represents this instance.

Returns
A string that represents this instance.

◆ tryParse()

static boolean fm.liveswitch.IPNetwork.tryParse ( String  cidr,
fm.liveswitch.Holder< fm.liveswitch.IPNetwork network 
)
static

Tries to parse a CIDR.

Parameters
cidrThe CIDR.
networkThe IP network.
Returns
true
if successful; otherwise,
false
.