Class IPV6Address

java.lang.Object
de.powerstat.validation.values.IPV6Address
All Implemented Interfaces:
IValueObject, Comparable<IPV6Address>

public final class IPV6Address extends Object implements Comparable<IPV6Address>, IValueObject
IP V6 address. DSGVO relevant. TODO ping ok?
  • Field Details

  • Constructor Details

  • Method Details

    • expandIPV4Address

      private static String expandIPV4Address(String address)
      Expand a possibly embedded IP V4 address.
      Parameters:
      address - IP V6 address
      Returns:
      IP V6 address
      Throws:
      NullPointerException - if address is null
      IllegalArgumentException - if address is not an ip v4 address
    • countColons

      private static int countColons(String str)
      Count colons.
      Parameters:
      str - String to count coolons in
      Returns:
      Numbe rof colons found
    • expandExpansionBlock

      private static String expandExpansionBlock(String address)
      Expand possible expansion block.
      Parameters:
      address - IP V6 address
      Returns:
      IP V6 address
    • normalizeIPV6Address

      private static String normalizeIPV6Address(String address)
      Normalize IP V6 address.
      Parameters:
      address - IP V6 address
      Returns:
      Normalized IP V6 address
    • of

      public static IPV6Address of(String address)
      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

      public String stringValue()
      Returns the value of this IPV6Address as a string.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The text value represented by this object after conversion to type string.
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String 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]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this IPV6Address
      See Also:
    • compareTo

      public int compareTo(IPV6Address obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<IPV6Address>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also: