public static boolean isIPv4(String ipAddress){
  if (ipAddress == null || ipAddress.isEmpty()) {
    return false;
  }
  Matcher ipv4Matcher=IP_V4_PATTERN.matcher(ipAddress);
  return ipv4Matcher.find();
}

public static boolean isIPv4 ( String ipAddress ) { if ( ipAddress == null || ipAddress . isEmpty ( ) ) { return false ; } Matcher ipv4Matcher = IP_V4_PATTERN . matcher ( ipAddress ) ; return ipv4Matcher . find ( ) ; }
determines if ip address is ip version 4 .
