Class IPWithSubnetChecker


  • public class IPWithSubnetChecker
    extends java.lang.Object
    Checks if the given string is a IP4 range subnet definition of the format 192.168.0/24 Based on a contribution by Jan Engler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.regex.Pattern IP_SUB_PATTERN  
      private static java.util.regex.Pattern IP6_SUB_PATTERN  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isValidIP4Range​(java.lang.String possibleIPAddress)
      Tests if a given string is of in the correct format for an IP4 subnet mask.
      static boolean isValidIP6Range​(java.lang.String possibleIPAddress)
      Tests if a given string is of in the correct format for an IP6 subnet mask.
      • Methods inherited from class java.lang.Object

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

      • IP_SUB_PATTERN

        private static java.util.regex.Pattern IP_SUB_PATTERN
      • IP6_SUB_PATTERN

        private static java.util.regex.Pattern IP6_SUB_PATTERN
    • Constructor Detail

      • IPWithSubnetChecker

        public IPWithSubnetChecker()
    • Method Detail

      • isValidIP4Range

        public static boolean isValidIP4Range​(java.lang.String possibleIPAddress)
        Tests if a given string is of in the correct format for an IP4 subnet mask.
        Parameters:
        possibleIPAddress - to test for valid format.
        Returns:
        true if valid else false.
      • isValidIP6Range

        public static boolean isValidIP6Range​(java.lang.String possibleIPAddress)
        Tests if a given string is of in the correct format for an IP6 subnet mask.
        Parameters:
        possibleIPAddress - to test for valid format.
        Returns:
        true if valid else false.