Record Class BankConnection
java.lang.Object
java.lang.Record
net.tangly.core.BankConnection
- Record Components:
iban- iban of the bank connectionbic- bic of the bank connectioninstitute- institute of the bank connection
Describes a bank connection with IBAN account number, BIC identification and name of the institute. The class is immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionBankConnection(@NotNull String iban) BankConnection(@NotNull String iban, String bic) BankConnection(@NotNull String iban, String bic, String institute) Creates an instance of aBankConnectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbic()Returns the value of thebicrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringiban()Returns the value of theibanrecord component.Returns the value of theinstituterecord component.static BankConnectionBuilds a bank connection object from a comma separated string representation.static BankConnectionFactory method to construct a bank connection.text()Returns a comma-separated representation of a bank connection.final StringtoString()Returns a string representation of this record class.static booleanvalidateBic(String bic) Validates a string representing a formatted bic number.static booleanvalidateIban(@NotNull String iban) Validates a string representing a formatted iban number.
-
Constructor Details
-
BankConnection
-
BankConnection
-
BankConnection
-
-
Method Details
-
of
Factory method to construct a bank connection.- Parameters:
iban- iban of the bank connectionbic- bic of the bank connectioninstitute- institute of the bank connection- Returns:
- new bank connection
-
of
Builds a bank connection object from a comma separated string representation.- Parameters:
text- comma separated representation of the address instance- Returns:
- new address object
- See Also:
-
validateIban
Validates a string representing a formatted iban number.- Parameters:
iban- iban number to validate- Returns:
- true, if iban is valid otherwise false
-
validateBic
Validates a string representing a formatted bic number.- Parameters:
bic- bic number to validate- Returns:
- true, if the bic is valid otherwise false
-
text
Returns a comma-separated representation of a bank connection. Null values are shown as empty strings. TheObject.toString()method is not used because the implementation is defined in the API implementation of record construct. The generated string can be feed to theof(String)to create a bank connection object.- Returns:
- comma separated representation
- See Also:
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
iban
-
bic
-
institute
-