java.lang.Object
de.powerstat.validation.values.PoBoxNumber
- All Implemented Interfaces:
IValueObject,Comparable<PoBoxNumber>
Address Post office box number.
DSGVO relevant.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(PoBoxNumber obj) Compare with another object.booleanIs equal with another object.inthashCode()Calculate hash code.longReturns the value of this BFPONumber as a long.static PoBoxNumberof(long poBoxNumber) PoBoxNumber factory.static PoBoxNumberPoBoxNumber factory.Returns the value of this PoBoNumber as a string.toString()Returns the string representation of this PoBoxNumber.
-
Field Details
-
poBoxNumber
private final long poBoxNumberPost office box number.
-
-
Constructor Details
-
PoBoxNumber
private PoBoxNumber(long poBoxNumber) Constructor.- Parameters:
poBoxNumber- PO box number 1-..- Throws:
IndexOutOfBoundsException- When the poBoxNumber is less than 1
-
-
Method Details
-
of
PoBoxNumber factory.- Parameters:
poBoxNumber- PoBox number 1-..- Returns:
- PoBoxNumber object
-
of
PoBoxNumber factory.- Parameters:
value- PoBox number 1-.. string- Returns:
- PoBoxNumber object
-
longValue
public long longValue()Returns the value of this BFPONumber as a long.- Returns:
- The numeric value represented by this object after conversion to type long.
-
stringValue
Returns the value of this PoBoNumber as a string.- Specified by:
stringValuein 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 PoBoxNumber. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "PoBoxNumber[poBoxNumber=4711]" -
compareTo
Compare with another object.- Specified by:
compareToin interfaceComparable<PoBoxNumber>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-