java.lang.Object
de.powerstat.validation.values.BuildingNr
- All Implemented Interfaces:
IValueObject
,Comparable<BuildingNr>
Address Building number.
Possibly DSGVO relevant.
TODO optimize constructor/compareTo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(BuildingNr obj) Compare with another object.boolean
Is equal with another object.int
hashCode()
Calculate hash code.static BuildingNr
BuildingNr factory.Returns the value of this BuildingNr as a string.toString()
Returns the string representation of this BuildingNr.
-
Field Details
-
BUILDINGNR_REGEXP
Building nr regexp. -
MAX_KNOWN_BUILDING_NR
private static final int MAX_KNOWN_BUILDING_NRMaximum known building nr in the world.- See Also:
-
buildingNr
Building number.
-
-
Constructor Details
-
BuildingNr
Constructor.- Parameters:
buildingNr
- Building number- Throws:
NullPointerException
- if buildingNr is nullIllegalArgumentException
- if buildingNr is not an correct buildingNr
-
-
Method Details
-
of
BuildingNr factory.- Parameters:
buildingNr
- Building number- Returns:
- BuildingNr object
-
stringValue
Returns the value of this BuildingNr 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 BuildingNr. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "BuildingNr[buildingNr=42]" -
compareTo
Compare with another object.- Specified by:
compareTo
in interfaceComparable<BuildingNr>
- Parameters:
obj
- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-