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

public final class City extends Object implements Comparable<City>, IValueObject
Address City. Not DSGVO relevant.
  • Field Details

    • CITY_REGEXP

      private static final Pattern CITY_REGEXP
      City name regexp.
    • city

      private final String city
      City.
  • Constructor Details

  • Method Details

    • of

      public static City of(String city)
      City factory.
      Parameters:
      city - City
      Returns:
      City object
    • stringValue

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

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