Package eu.webtoolkit.jwt
Class Configuration.Network
java.lang.Object
eu.webtoolkit.jwt.Configuration.Network
- Enclosing class:
- Configuration
A class describing an IPv4 or IPv6 network
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(InetAddress address) Checks whether this network contains the given addressstatic Configuration.Network
fromString
(String s) Creates a network from CIDR notation
-
Field Details
-
address
-
prefixLength
public final int prefixLength
-
-
Constructor Details
-
Network
Constructor- Throws:
IllegalArgumentException
- if the prefix length is not valid for the type of IP address
-
-
Method Details
-
fromString
Creates a network from CIDR notationThis parses either an IPv4 or IPv6 network in CIDR notation, e.g. 192.168.0.0/16 or fe80::/10, or if the slash is omitted, it is treated as the subnetwork that only contains that specific address, e.g. 192.168.1.1 is interpreted as 192.168.1.1/32.
- Parameters:
s
- the network in CIDR notation e.g. 192.168.0.0/16, or fe80::/10- Throws:
IllegalArgumentException
- if the address can not be parsed or the prefix length is not valid for the type of IP address
-
contains
Checks whether this network contains the given address
-