Package com.soebes.ip

Class IPv6Address

java.lang.Object
com.soebes.ip.IPv6Address
All Implemented Interfaces:
Comparator<IPv6Address>

@API(status=EXPERIMENTAL, since="0.0.1") public final class IPv6Address extends Object implements Comparator<IPv6Address>
Represents an IP Version 6 address.
Author:
Karl Heinz Marbaise
See Also:
  • Field Details

    • LOOPBACK

      public static final IPv6Address LOOPBACK
      The loopback address
    • UNSPECIFIED

      public static final IPv6Address UNSPECIFIED
      The unspecified address is used to be compared to or as a default initialization.
  • Method Details

    • isUnicastAddress

      public boolean isUnicastAddress()
    • isMulticastAddress

      public boolean isMulticastAddress()
    • isLoopbackAddress

      public boolean isLoopbackAddress()
      Returns:
      true if the current IPv6 represents the LOOPBACK, false otherwise.
    • isUnspecifiedAddress

      public boolean isUnspecifiedAddress()
      Returns:
      true if the current IPv6 represents the UNSPECIFIED, false otherwise.
    • of

      public static IPv6Address of(String ip6)
      Parameters:
      ip6 - The given string representation of an IP Version 6 address.
      Returns:
      The instance of IPv6Address.
    • of

      public static IPv6Address of(int[] ip6)
      Parameters:
      ip6 - The eight tuples each 16 bit unsigned.
      Returns:
      An IPv6Address.
      Throws:
      IllegalArgumentException - in case of failures.
    • compare

      public int compare(IPv6Address o1, IPv6Address o2)
      Specified by:
      compare in interface Comparator<IPv6Address>
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Comparator<IPv6Address>
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object