public class IpV4Subnet extends Object implements IpSet, Comparable<IpV4Subnet>
Constructor and Description |
---|
IpV4Subnet()
Create IpV4Subnet for ALL (used for ALLOW or DENY ALL)
|
IpV4Subnet(InetAddress inetAddress,
int cidrNetMask)
Create IpV4Subnet using the CIDR Notation
|
IpV4Subnet(InetAddress inetAddress,
String netMask)
Create IpV4Subnet using the normal Notation
|
IpV4Subnet(String netAddress)
Create IpV4Subnet using the CIDR or normal Notation
i.e.: IpV4Subnet subnet = new IpV4Subnet("10.10.10.0/24"); or IpV4Subnet subnet = new IpV4Subnet("10.10.10.0/255.255.255.0"); |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IpV4Subnet o)
Compare two IpV4Subnet
|
boolean |
contains(InetAddress inetAddress1)
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 IpV4Subnet()
public IpV4Subnet(String netAddress) throws UnknownHostException
netAddress
- a network address as string.UnknownHostException
public IpV4Subnet(InetAddress inetAddress, int cidrNetMask)
public IpV4Subnet(InetAddress inetAddress, String netMask)
public boolean contains(String ipAddr) throws UnknownHostException
ipAddr
- an ipaddressUnknownHostException
public boolean contains(InetAddress inetAddress1)
public int compareTo(IpV4Subnet o)
compareTo
in interface Comparable<IpV4Subnet>
Copyright © 2008-2014 The Netty Project. All Rights Reserved.