Java Utililty Methods IP Address Validate

List of utility methods to do IP Address Validate

Description

The list of methods to do IP Address Validate are organized into topic(s).

Method

booleanisIPv6(String address)
is I Pv
return IPV6_PATTERN.matcher(address).matches();
booleanisIpV6Address(CharSequence address)
is Ip V Address
if (address == null) {
    return false;
return IPV6_PATTERN.matcher(address).matches();
booleanisIPv6Address(final String input)
is I Pv Address
return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input);
booleanisIPv6Address(final String input)
Checks whether the parameter is a valid IPv6 address (including compressed).
return isIPv6StdAddress(input) || isIPv6HexCompressedAddress(input);
booleanisIPv6Address(String _ipAddress)
Checks if given String is an IPv6 address.
return IPV6_PATTERN.matcher(_ipAddress).matches();
booleanisIPv6HexCompressedAddress(final String input)
Checks whether the parameter is a valid compressed IPv6 address
int colonCount = 0;
for (int i = 0; i < input.length(); i++) {
    if (input.charAt(i) == COLON_CHAR) {
        colonCount++;
return colonCount <= MAX_COLON_COUNT && IPV6_HEX_COMPRESSED_PATTERN.matcher(input).matches();
booleanisIPv6HexCompressedAddress(final String input)
is I Pv Hex Compressed Address
return IPV6_HEX_COMPRESSED_PATTERN.matcher(input).matches();
booleanisIPv6HexCompressedAddress(String ip)
is I Pv Hex Compressed Address
int count = 0;
for (int i = 0, length = ip.length(); i < length; i++) {
    if (ip.charAt(i) == COLON_CHAR) {
        count++;
return count <= MAX_COLON_COUNT && IPV6_HEX_COMPRESSED_PATTERN.matcher(ip).matches();
booleanisIPv6LiteralAddress(String src)
is I Pv Literal Address
return textToNumericFormatV6(src) != null;
booleanisIpV6RegexValid(String strIp)
check if IP v6 string is valid by regex.
final String regexV6 = "^([\\da-fA-F]{1,4}:){6}" + "((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}"
        + "(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|" + "^::([\\da-fA-F]{1,4}:){0,5}"
        + "((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}" + "(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|"
        + "^([\\da-fA-F]{1,4}:):([\\da-fA-F]{1,4}:){0,4}" + "((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}"
        + "(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|" + "^([\\da-fA-F]{1,4}:){2}:([\\da-fA-F]{1,4}:){0,3}"
        + "((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}" + "(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|"
        + "^([\\da-fA-F]{1,4}:){3}:([\\da-fA-F]{1,4}:){0,2}" + "((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}"
        + "(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$|" + "^([\\da-fA-F]{1,4}:){4}:([\\da-fA-F]{1,4}:){0,1}"
...