
public class IpSubnet extends Object implements IpSet, Comparable<IpSubnet>
| Constructor and Description |
|---|
IpSubnet()
Create IpSubnet for ALL (used for ALLOW or DENY ALL)
|
IpSubnet(InetAddress inetAddress,
int cidrNetMask)
Create IpSubnet using the CIDR Notation
|
IpSubnet(InetAddress inetAddress,
String netMask)
Create IpSubnet using the normal Notation
|
IpSubnet(String netAddress)
Create IpSubnet using the CIDR or normal Notation
i.e. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IpSubnet o)
Compare two IpSubnet
|
boolean |
contains(InetAddress inetAddress)
Compares the given InetAddress against the Subnet and returns true if
the ip is in the subnet-ip-range and false if not.
|
boolean |
contains(String ipAddr)
Compares the given IP-Address against the Subnet and returns true if
the ip is in the subnet-ip-range and false if not.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
public IpSubnet()
public IpSubnet(String netAddress) throws UnknownHostException
netAddress - a network address as string.UnknownHostExceptionpublic IpSubnet(InetAddress inetAddress, int cidrNetMask) throws UnknownHostException
UnknownHostExceptionpublic IpSubnet(InetAddress inetAddress, String netMask) throws UnknownHostException
UnknownHostExceptionpublic boolean contains(String ipAddr) throws UnknownHostException
ipAddr - an ipaddressUnknownHostExceptionpublic boolean contains(InetAddress inetAddress)
public int compareTo(IpSubnet o)
compareTo in interface Comparable<IpSubnet>Copyright © 2008-2013 The Netty Project. All Rights Reserved.