类 InetAddressValidator
java.lang.Object
com.alibaba.nacos.common.utils.InetAddressValidator
ipv4 ipv6 check util.
- 作者:
- Dynatrace LLC
-
方法概要
修饰符和类型方法说明static booleanisIpv4Address(String input) Check ifinputis a valid IPv4 address.static booleanisIpv6Address(String input) Check ifinputis a IPv6 address.static booleanisIpv6HexCompressedAddress(String input) Check if the given address is a valid IPv6 address in the hex-compressed notation The format is 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'.static booleanisIpv6Ipv4MappedAddress(String input) Check ifinputis an IPv4 address mapped into a IPv6 address.static booleanisIpv6MixedAddress(String input) Check if the given address is a valid IPv6 address in the mixed-standard or mixed-compressed notation.static booleanisIpv6StdAddress(String input) Check if the given address is a valid IPv6 address in the standard format The format is 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'.static booleanCheck ifinputis a link local IPv6 address starting with "fe80:" and containing a zone index with "%xxx".
-
方法详细资料
-
isIpv4Address
Check ifinputis a valid IPv4 address. The format is 'xxx.xxx.xxx.xxx'. Four blocks of integer numbers ranging from 0 to 255 are required. Letters are not allowed.- 参数:
input- ip-address to check- 返回:
- true if
inputis in correct IPv4 notation.
-
isIpv6StdAddress
Check if the given address is a valid IPv6 address in the standard format The format is 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'. Eight blocks of hexadecimal digits are required.- 参数:
input- ip-address to check- 返回:
- true if
inputis in correct IPv6 notation.
-
isIpv6HexCompressedAddress
Check if the given address is a valid IPv6 address in the hex-compressed notation The format is 'xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx'. If all digits in a block are '0' the block can be left empty.- 参数:
input- ip-address to check- 返回:
- true if
inputis in correct IPv6 (hex-compressed) notation.
-
isIpv6Address
Check ifinputis a IPv6 address. Possible notations for valid IPv6 are: - Standard IPv6 address - Hex-compressed IPv6 address - Link-local IPv6 address - IPv4-mapped-to-IPV6 address - IPv6 mixed address- 参数:
input- ip-address to check- 返回:
- true if
inputis in correct IPv6 notation.
-
isIpv6MixedAddress
Check if the given address is a valid IPv6 address in the mixed-standard or mixed-compressed notation. IPV6 Mixed mode consists of two parts, the first 96 bits (up to 6 blocks of 4 hex digits) are IPv6 the IPV6 part can be either compressed or uncompressed the second block is a full IPv4 address e.g. '0:0:0:0:0:0:172.12.55.18'- 参数:
input- ip-address to check- 返回:
- true if
inputis in correct IPv6 (mixed-standard or mixed-compressed) notation.
-
isIpv6Ipv4MappedAddress
Check ifinputis an IPv4 address mapped into a IPv6 address. These are starting with "::ffff:" followed by the IPv4 address in a dot-seperated notation. The format is '::ffff:d.d.d.d'- 参数:
input- ip-address to check- 返回:
- true if
inputis in correct IPv6 notation containing an IPv4 address
-
isLinkLocalIpv6WithZoneIndex
Check ifinputis a link local IPv6 address starting with "fe80:" and containing a zone index with "%xxx". The zone index will not be checked.- 参数:
input- ip-address to check- 返回:
- true if address part of
inputis in correct IPv6 notation.
-