org.apache.hc.core5.net

## Class InetAddressUtils

- java.lang.Object
- - org.apache.hc.core5.net.InetAddressUtils

-     public class InetAddressUtils
      extends Object

  A collection of utilities relating to InetAddresses.
  Since:
    4.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static byte` | `IPV4` Represents the ipv4
    `static byte` | `IPV6` Represents the ipv6.

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `formatAddress(StringBuilder buffer, SocketAddress socketAddress)` Formats `SocketAddress` as text.
    `static String` | `getCanonicalLocalHostName()` Returns canonical name (fully qualified domain name) of the localhost.
    `static boolean` | `isIPv4(CharSequence input)` Checks whether the parameter is a valid IPv4 address
    `static boolean` | `isIPv4Address(String input)` Deprecated. Use `isIPv4(CharSequence)`
    `static boolean` | `isIPv4MappedIPv6(CharSequence input)` Check if an IPv6 address is an IPv4-mapped IPv6 address.
    `static boolean` | `isIPv4MappedIPv64Address(String input)` Deprecated. Use `isIPv4MappedIPv6(CharSequence)`
    `static boolean` | `isIPv6(CharSequence input)` Checks whether the parameter is a valid IPv6 address (including compressed).
    `static boolean` | `isIPv6Address(String input)` Deprecated. Use `isIPv6(CharSequence)`
    `static boolean` | `isIPv6HexCompressed(CharSequence input)` Checks whether the parameter is a valid compressed IPv6 address
    `static boolean` | `isIPv6HexCompressedAddress(String input)` Deprecated. Use `isIPv6HexCompressed(CharSequence)`
    `static boolean` | `isIPv6Std(CharSequence input)` Checks whether the parameter is a valid standard (non-compressed) IPv6 address
    `static boolean` | `isIPv6StdAddress(String input)` Deprecated. Use `isIPv6Std(CharSequence)`
    `static boolean` | `isIPv6URLBracketed(CharSequence input)` Checks whether the parameter is a valid URL formatted bracketed IPv6 address (including compressed).
    `static boolean` | `isIPv6URLBracketedAddress(String input)` Deprecated. Use `isIPv6URLBracketed(CharSequence)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### IPV4

          public static final byte IPV4

      Represents the ipv4
      Since:
        5.1
      See Also:
        Constant Field Values

    - #### IPV6

          public static final byte IPV6

      Represents the ipv6.
      Since:
        5.1
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### isIPv4Address

          @Deprecated
          public static boolean isIPv4Address(String input)

      Deprecated. Use `isIPv4(CharSequence)`

    - #### isIPv4

          public static boolean isIPv4(CharSequence input)

      Checks 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
          public static boolean isIPv4MappedIPv64Address(String input)

      Deprecated. Use `isIPv4MappedIPv6(CharSequence)`

    - #### isIPv4MappedIPv6

          public static boolean isIPv4MappedIPv6(CharSequence input)

      Check 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
          public static boolean isIPv6StdAddress(String input)

      Deprecated. Use `isIPv6Std(CharSequence)`

    - #### isIPv6Std

          public static boolean isIPv6Std(CharSequence input)

      Checks 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
          public static boolean isIPv6HexCompressedAddress(String input)

      Deprecated. Use `isIPv6HexCompressed(CharSequence)`

    - #### isIPv6HexCompressed

          public static boolean isIPv6HexCompressed(CharSequence input)

      Checks 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
          public static boolean isIPv6Address(String input)

      Deprecated. Use `isIPv6(CharSequence)`

    - #### isIPv6

          public static boolean isIPv6(CharSequence input)

      Checks 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
          public static boolean isIPv6URLBracketedAddress(String input)

      Deprecated. Use `isIPv6URLBracketed(CharSequence)`

    - #### isIPv6URLBracketed

          public static boolean isIPv6URLBracketed(CharSequence input)

      Checks 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

          public static void formatAddress(StringBuilder buffer,
                                           SocketAddress socketAddress)

      Formats `SocketAddress` as text.
      Since:
        5.0

    - #### getCanonicalLocalHostName

          public static String getCanonicalLocalHostName()

      Returns canonical name (fully qualified domain name) of the localhost.
      Since:
        5.0

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.