Class Firstname

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

public final class Firstname extends Object implements Comparable<Firstname>, IValueObject
Firstname. DSGVO relevant.
See Also:
  • Field Details

    • FIRSTNAME_REGEXP

      private static final Pattern FIRSTNAME_REGEXP
      Firstname regexp.
    • firstname

      private final String firstname
      Firstname.
  • Constructor Details

    • Firstname

      private Firstname(String firstname)
      Constructor.
      Parameters:
      firstname - Firstname (maximum 32 characters)
      Throws:
      NullPointerException - if firstname is null
      IllegalArgumentException - if firstname contains unsupported characters or is to long or short
  • Method Details

    • of

      public static Firstname of(String firstname)
      Firstname factory.
      Parameters:
      firstname - Firstname
      Returns:
      Firstname object
    • stringValue

      public String stringValue()
      Returns the value of this Firstname 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 Firstname. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "Firstname[firstname=Kai]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this Firstname
      See Also:
    • compareTo

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