Package org.apache.cassandra.cql3
Class CIDR
java.lang.Object
org.apache.cassandra.cql3.CIDR
Contains a CIDR, and operations on it
-
Constructor Summary
ConstructorsConstructorDescriptionCIDR(InetAddress ipAddress, short netMask) Generates a CIDR from given IP and netmask -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareIPs(InetAddress l, InetAddress r) Compare 2 IpAddresses objects lexicographicallybooleanGet ending IP of the CIDRstatic CIDRgetInstance(String cidrStr) Generates a CIDR from given stringshortGet netmask of the CIDRGet starting IP of the CIDRinthashCode()booleanisIPv4()Tells is this IPv4 format CIDRbooleanisIPv6()Tells is this IPv6 format CIDRstatic booleantoString()Constructs CIDR as string
-
Constructor Details
-
CIDR
Generates a CIDR from given IP and netmask- Parameters:
ipAddress- IP address of CIDRnetMask- netmask of CIDR
-
-
Method Details
-
getInstance
Generates a CIDR from given string- Parameters:
cidrStr- CIDR as string
-
getStartIpAddress
Get starting IP of the CIDR- Returns:
- returns IP address
-
getEndIpAddress
Get ending IP of the CIDR- Returns:
- returns IP address
-
getNetMask
public short getNetMask()Get netmask of the CIDR- Returns:
- returns netmask as short
-
isIPv4
public boolean isIPv4()Tells is this IPv4 format CIDR- Returns:
- true if IPv4 CIDR, otherwise false
-
isIPv6
public boolean isIPv6()Tells is this IPv6 format CIDR- Returns:
- true if IPv6 CIDR, otherwise false
-
equals
-
hashCode
public int hashCode() -
toString
Constructs CIDR as string -
asCqlTupleString
-
compareIPs
Compare 2 IpAddresses objects lexicographically- Returns:
- true if IP ranges overlap with each other; otherwise, return false
-
overlaps
-