Class IPAddress


  • public class IPAddress
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.math.BigInteger ZERO  
    • Constructor Summary

      Constructors 
      Constructor Description
      IPAddress()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isValid​(java.lang.String address)
      Validate the given IPv4 or IPv6 address.
      private static boolean isValidIPv4​(java.lang.String address)
      Validate the given IPv4 address.
      private static boolean isValidIPv6​(java.lang.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
    • Field Detail

      • ZERO

        private static final java.math.BigInteger ZERO
    • Constructor Detail

      • IPAddress

        public IPAddress()
    • Method Detail

      • isValid

        public static boolean isValid​(java.lang.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
      • isValidIPv4

        private static boolean isValidIPv4​(java.lang.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

        private static boolean isValidIPv6​(java.lang.String address)
        Validate the given IPv6 address.
        Parameters:
        address - the IP address as a String.
        Returns:
        true if a valid IPv4 address, false otherwise