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
FieldsModifier and TypeFieldDescriptionstatic final IPv6AddressThe loopback addressstatic final IPv6AddressThe unspecified address is used to be compared to or as a default initialization. -
Method Summary
Modifier and TypeMethodDescriptionintcompare(IPv6Address o1, IPv6Address o2) booleaninthashCode()booleanbooleanbooleanbooleanstatic IPv6Addressof(int[] ip6) static IPv6AddresstoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
comparein interfaceComparator<IPv6Address>
-
equals
- Specified by:
equalsin interfaceComparator<IPv6Address>- Overrides:
equalsin classObject
-
hashCode
public int hashCode() -
toString
-