Class IPAddress

  • All Implemented Interfaces:

    
    public class IPAddress
    
                        

    Utility methods for processing String objects containing IP addresses.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      IPAddress()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static boolean isValid(String address) Validate the given IPv4 or IPv6 address.
      static boolean isValidWithNetMask(String address) Validate the given IPv4 or IPv6 address and netmask.
      static boolean isValidIPv4(String address) Validate the given IPv4 address.
      static boolean isValidIPv4WithNetmask(String address)
      static boolean isValidIPv6WithNetmask(String address)
      static boolean isValidIPv6(String address) Validate the given IPv6 address.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IPAddress

        IPAddress()
    • Method Detail

      • isValid

         static boolean isValid(String address)

        Validate the given IPv4 or IPv6 address.

        Parameters:
        address - the IP address as a String.
        Returns:

        true if a valid address, false otherwise

      • isValidWithNetMask

         static boolean isValidWithNetMask(String address)

        Validate the given IPv4 or IPv6 address and netmask.

        Parameters:
        address - the IP address as a String.
        Returns:

        true if a valid address with netmask, false otherwise

      • isValidIPv4

         static boolean isValidIPv4(String address)

        Validate the given IPv4 address.

        Parameters:
        address - the IP address as a String.
        Returns:

        true if a valid IPv4 address, false otherwise

      • isValidIPv6

         static boolean isValidIPv6(String address)

        Validate the given IPv6 address.

        Parameters:
        address - the IP address as a String.
        Returns:

        true if a valid IPv6 address, false otherwise