Package org.jppf.net

Class IPv4AddressNetmask


public class IPv4AddressNetmask extends IPv4AddressPattern
Represents a netmask used for IP addresses include or exclude lists.
A netmask is in CIDR notation and represents an IP address of which only the first N bits are significant.

If no slash is included, the string is treated as a IPv4AddressPattern; otherwise it must be a valid IPv4 address.

Examples:

  • 192.168.1.10 represents a single IP address
  • 192.168.1.10/32 represents a single IP address, where all 32 bits are significant.
  • 192.168.1.0/24 represents all IP addresses in the range 192.168.1.0 - 192.168.1.255
  • 192.168.0.0/16 represents all IP addresses in the range 192.168.0.0 - 192.168.255.255
  • 192.160.0.0/12 represents all IP addresses in the range 192.160.0.0 - 192.175.255.255
Since:
4.2
Author:
Daniel Widdis
  • Constructor Details

    • IPv4AddressNetmask

      public IPv4AddressNetmask(String source) throws IllegalArgumentException
      Initialize this object with the specified string pattern.
      Parameters:
      source - the source pattern as a string.
      Throws:
      IllegalArgumentException - if the pattern is null or invalid.
  • Method Details

    • main

      public static void main(String[] args)
      Main method.
      Parameters:
      args - not used.