Class Configuration.Network

java.lang.Object
eu.webtoolkit.jwt.Configuration.Network
Enclosing class:
Configuration

public static class Configuration.Network extends Object
A class describing an IPv4 or IPv6 network
  • Field Details

    • address

      public final InetAddress address
    • prefixLength

      public final int prefixLength
  • Constructor Details

  • Method Details

    • fromString

      public static Configuration.Network fromString(String s)
      Creates a network from CIDR notation

      This 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

      public boolean contains(InetAddress address)
      Checks whether this network contains the given address