java.lang.Object
de.powerstat.validation.values.IBAN
- All Implemented Interfaces:
IValueObject,Comparable<IBAN>
IBAN.
Probably DSGVO relevant.
TODO https://openiban.com/
TODO Human format in/out
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare with another object.booleanIs equal with another object.inthashCode()Calculate hash code.static IBANIBAN factory.Returns the value of this IBAN as a string.toString()Returns the string representation of this IBAN.private static booleanverifyChecksum(String iban) Calculate ISO 7064 mod 97-10 checksum.
-
Field Details
-
IBAN_REGEXP
IBAN regexp. -
iban
IBAN.
-
-
Constructor Details
-
IBAN
Constructor.- Parameters:
iban- IBAN- Throws:
NullPointerException- if iban is nullIllegalArgumentException- if iban is not an correct iban
-
-
Method Details
-
verifyChecksum
Calculate ISO 7064 mod 97-10 checksum.- Parameters:
iban- IBAN- Returns:
- true when checksum is correct, false otherwise
-
of
IBAN factory.- Parameters:
iban- IBAN- Returns:
- IBAN object
-
stringValue
Returns the value of this IBAN 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 IBAN. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "IBAN[iban=DE68210501700012345678]" -
compareTo
Compare with another object.- Specified by:
compareToin interfaceComparable<IBAN>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-