java.lang.Object
de.powerstat.validation.values.IPV6Address
- All Implemented Interfaces:
IValueObject
,Comparable<IPV6Address>
IP V6 address.
DSGVO relevant.
TODO ping ok?
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
IP V6 address.private static final String
IPV6 zero block.private final String[]
IP V6 address parts.private static final String
Hex output format.private static final String
IPV6 block expansion.private static final Pattern
IP V6 regexp.private static final String
IPV6 block separator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(IPV6Address obj) Compare with another object.private static int
countColons
(String str) Count colons.boolean
Is equal with another object.private static String
expandExpansionBlock
(String address) Expand possible expansion block.private static String
expandIPV4Address
(String address) Expand a possibly embedded IP V4 address.int
hashCode()
Calculate hash code.boolean
Is an IP V6 private address.boolean
isPublic()
Is an IP V6 public address. 0:0:0:0:0:ffff::/96 IPv4 mapped (abgebildete) IPv6 Adressen 2000::/3 IANA vergebenen globalen Unicast 2001 Provider area 2001:0: Toredo 2001:0db8::/32 Documentation purposes 2002 6to4 tunnel 2003, 0240, 0260, 0261, 0262, 0280, 02a0, 02b0 und 02c0 Regional Internet Registries (RIRs) 0064:ff9b::/96 NAT64boolean
Is an IP V6 special address. 0:0:0:0:0:0:0:0 default route 0:0:0:0:0:0:0:1 loopback ff Multicastprivate static String
normalizeIPV6Address
(String address) Normalize IP V6 address.static IPV6Address
IPV6Address factory.Returns the value of this IPV6Address as a string.toString()
Returns the string representation of this IPV6Address.
-
Field Details
-
IPV6_REGEXP
IP V6 regexp. -
BLOCK_ZERO
IPV6 zero block.- See Also:
-
HEX_OUTPUT
Hex output format.- See Also:
-
IPV6_EXP
IPV6 block expansion.- See Also:
-
IV6_SEP
IPV6 block separator.- See Also:
-
address
IP V6 address. -
blocks
IP V6 address parts.
-
-
Constructor Details
-
IPV6Address
Constructor.- Parameters:
address
- IP V6 address- Throws:
NullPointerException
- if address is nullIllegalArgumentException
- if address is not an ip v6 address
-
-
Method Details
-
expandIPV4Address
Expand a possibly embedded IP V4 address.- Parameters:
address
- IP V6 address- Returns:
- IP V6 address
- Throws:
NullPointerException
- if address is nullIllegalArgumentException
- if address is not an ip v4 address
-
countColons
Count colons.- Parameters:
str
- String to count coolons in- Returns:
- Numbe rof colons found
-
expandExpansionBlock
Expand possible expansion block.- Parameters:
address
- IP V6 address- Returns:
- IP V6 address
-
normalizeIPV6Address
Normalize IP V6 address.- Parameters:
address
- IP V6 address- Returns:
- Normalized IP V6 address
-
of
IPV6Address factory.- Parameters:
address
- IP V6 address- Returns:
- IPV6address object
-
isPrivate
public boolean isPrivate()Is an IP V6 private address. fc Unique Local Unicast fd Unique Local Unicast fe:80:00:00:00:00:00:00 Link-Local- Returns:
- true if private, false otherwise
-
isSpecial
public boolean isSpecial()Is an IP V6 special address. 0:0:0:0:0:0:0:0 default route 0:0:0:0:0:0:0:1 loopback ff Multicast- Returns:
- true if special, false otherwise
-
isPublic
public boolean isPublic()Is an IP V6 public address. 0:0:0:0:0:ffff::/96 IPv4 mapped (abgebildete) IPv6 Adressen 2000::/3 IANA vergebenen globalen Unicast 2001 Provider area 2001:0: Toredo 2001:0db8::/32 Documentation purposes 2002 6to4 tunnel 2003, 0240, 0260, 0261, 0262, 0280, 02a0, 02b0 und 02c0 Regional Internet Registries (RIRs) 0064:ff9b::/96 NAT64- Returns:
- true when public address, otherwise false
-
stringValue
Returns the value of this IPV6Address as a string.- Specified by:
stringValue
in interfaceIValueObject
- Returns:
- The text value represented by this object after conversion to type string.
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
toString
Returns the string representation of this IPV6Address. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "IPV6Address[address=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]" -
compareTo
Compare with another object.- Specified by:
compareTo
in interfaceComparable<IPV6Address>
- Parameters:
obj
- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-