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 Summary
Modifier and TypeFieldDescriptionstatic final IPv6Address
The loopback addressstatic final IPv6Address
The unspecified address is used to be compared to or as a default initialization. -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(IPv6Address o1, IPv6Address o2) boolean
int
hashCode()
boolean
boolean
boolean
boolean
static IPv6Address
of
(int[] ip6) static IPv6Address
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
LOOPBACK
The loopback address -
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
- Parameters:
ip6
- The given string representation of an IP Version 6 address.- Returns:
- The instance of
IPv6Address
.
-
of
- Parameters:
ip6
- The eight tuples each 16 bit unsigned.- Returns:
- An
IPv6Address
. - Throws:
IllegalArgumentException
- in case of failures.
-
compare
- Specified by:
compare
in interfaceComparator<IPv6Address>
-
equals
- Specified by:
equals
in interfaceComparator<IPv6Address>
- Overrides:
equals
in classObject
-
hashCode
public int hashCode() -
toString
-