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

public final class IPV6Mask extends Object implements Comparable<IPV6Mask>, IValueObject
IP V6 mask. Not DSGVO relevant.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    Prefix length.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    IPV6Mask(int length)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compare with another object.
    boolean
    Is equal with another object.
    int
    Calculate hash code.
    int
    Returns the value of this IPV6Mask as an int.
    static IPV6Mask
    of(int length)
    IPV6Mask factory.
    static IPV6Mask
    of(String value)
    IPV6Mask factory.
    Returns the value of this IPV6Mask as an String.
    Returns the string representation of this IPV4Address.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • length

      private final int length
      Prefix length.
  • Constructor Details

    • IPV6Mask

      private IPV6Mask(int length)
      Constructor.
      Parameters:
      length - Prefix length (0-128)
      Throws:
      IndexOutOfBoundsException - if the prefix length is < 0 or > 128
  • Method Details

    • of

      public static IPV6Mask of(int length)
      IPV6Mask factory.
      Parameters:
      length - IP V6 prefix length (0-128)
      Returns:
      IPV6Mask object
    • of

      public static IPV6Mask of(String value)
      IPV6Mask factory.
      Parameters:
      value - IP V6 prefix length string (0-128)
      Returns:
      IPV6Mask object
    • intValue

      public int intValue()
      Returns the value of this IPV6Mask as an int.
      Returns:
      The numeric value represented by this object after conversion to type int (0-128).
    • stringValue

      public String stringValue()
      Returns the value of this IPV6Mask as an String.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The numeric value represented by this object after conversion to type String (0-128).
    • 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 IPV4Address. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "IPV6Mask[length=128, mask=]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this IPV4Mask
      See Also:
    • compareTo

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