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

public final class IBAN extends Object implements Comparable<IBAN>, IValueObject
IBAN. Probably DSGVO relevant. TODO https://openiban.com/ TODO Human format in/out
  • Field Details

    • IBAN_REGEXP

      private static final Pattern IBAN_REGEXP
      IBAN regexp.
    • iban

      private final String iban
      IBAN.
  • Constructor Details

  • Method Details

    • verifyChecksum

      private static boolean verifyChecksum(String iban)
      Calculate ISO 7064 mod 97-10 checksum.
      Parameters:
      iban - IBAN
      Returns:
      true when checksum is correct, false otherwise
    • of

      public static IBAN of(String iban)
      IBAN factory.
      Parameters:
      iban - IBAN
      Returns:
      IBAN object
    • stringValue

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

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