Package org.apache.hc.core5.net
Class InetAddressUtils
java.lang.Object
org.apache.hc.core5.net.InetAddressUtils
A collection of utilities relating to InetAddresses.
- Since:
- 4.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidformatAddress(StringBuilder buffer, SocketAddress socketAddress) FormatsSocketAddressas text.static StringGets the canonical name of the local host, a fully qualified domain name.static booleanisIPv4(CharSequence input) Tests whether the parameter is a valid IPv4 address.static booleanisIPv4Address(String input) Deprecated.static booleanisIPv4MappedIPv6(CharSequence input) Tests if an IPv6 address is an IPv4-mapped IPv6 address.static booleanisIPv4MappedIPv64Address(String input) Deprecated.static booleanisIPv6(CharSequence input) Tests whether the parameter is a valid IPv6 address (including compressed).static booleanisIPv6Address(String input) Deprecated.static booleanisIPv6HexCompressed(CharSequence input) Tests whether the parameter is a valid compressed IPv6 addressstatic booleanisIPv6HexCompressedAddress(String input) Deprecated.static booleanisIPv6Std(CharSequence input) Tests whether the parameter is a valid standard (non-compressed) IPv6 addressstatic booleanisIPv6StdAddress(String input) Deprecated.static booleanisIPv6URLBracketed(CharSequence input) Tests whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed).static booleanisIPv6URLBracketedAddress(String input) Deprecated.
-
Field Details
-
IPV4
public static final byte IPV4Represents the ipv4- Since:
- 5.1
- See Also:
-
IPV6
public static final byte IPV6Represents the ipv6.- Since:
- 5.1
- See Also:
-
-
Method Details
-
isIPv4Address
Deprecated.Tests whether the parameter is a valid IPv4 address- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid IPv4 address
-
isIPv4
Tests whether the parameter is a valid IPv4 address.- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid IPv4 address
- Since:
- 5.3
-
isIPv4MappedIPv64Address
Deprecated.Tests if an IPv6 address is an IPv4-mapped IPv6 address.- Parameters:
input- the IPv6 address to be checked- Returns:
- true if the IPv6 address is an IPv4-mapped IPv6 address, false otherwise.
-
isIPv4MappedIPv6
Tests if an IPv6 address is an IPv4-mapped IPv6 address.- Parameters:
input- the IPv6 address to be checked- Returns:
- true if the IPv6 address is an IPv4-mapped IPv6 address, false otherwise.
- Since:
- 5.3
-
isIPv6StdAddress
Deprecated.Tests whether the parameter is a valid standard (non-compressed) IPv6 address- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid standard (non-compressed) IPv6 address
-
isIPv6Std
Tests whether the parameter is a valid standard (non-compressed) IPv6 address- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid standard (non-compressed) IPv6 address
- Since:
- 5.3
-
isIPv6HexCompressedAddress
Deprecated.Tests whether the parameter is a valid compressed IPv6 address- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid compressed IPv6 address
-
isIPv6HexCompressed
Tests whether the parameter is a valid compressed IPv6 address- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid compressed IPv6 address
- Since:
- 5.3
-
isIPv6Address
Deprecated.Tests whether the parameter is a valid IPv6 address (including compressed).- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid standard or compressed IPv6 address
-
isIPv6
Tests whether the parameter is a valid IPv6 address (including compressed).- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid standard or compressed IPv6 address
- Since:
- 5.3
-
isIPv6URLBracketedAddress
Deprecated.Tests whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed). This matches only bracketed values e.g.[::1].- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid URL-formatted bracketed IPv6 address
-
isIPv6URLBracketed
Tests whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed). This matches only bracketed values e.g.[::1].- Parameters:
input- the address character sequence to check for validity- Returns:
- true if the input parameter is a valid URL-formatted bracketed IPv6 address
- Since:
- 5.3
-
formatAddress
FormatsSocketAddressas text.- Parameters:
buffer- The target buffer to append.socketAddress- The SocketAddress to append tobuffer.- Since:
- 5.0
-
getCanonicalLocalHostName
Gets the canonical name of the local host, a fully qualified domain name.This can be
"localhost"or a fully qualified domain name like"host.docker.internal".- Returns:
- the canonical name of the local host.
- Since:
- 5.0
-
isIPv4(CharSequence)