Class SepaBankInfo

Namespace
Subsembly.Sepa
Assembly
Subsembly.Sepa.dll

Genric bank information that is used to map a BankCode to a BIC and other bank attributes.

public class SepaBankInfo : IComparable<SepaBankInfo>, IComparable
Inheritance
SepaBankInfo
Implements
Inherited Members

Remarks

Comparing SepaBankInfo instances via IComparable, only compares the CountryCode and the BankCode. Together these should be unique in any container.

Constructors

SepaBankInfo()

public SepaBankInfo()

SepaBankInfo(string, string, SepaBIC, string)

public SepaBankInfo(string sCountryCode, string sBankCode, SepaBIC tBIC, string sBankName)

Parameters

sCountryCode string
sBankCode string

The bank code without padding.

tBIC SepaBIC
sBankName string

Optional bank name, may be null if not known.

Properties

BIC

The BIC of this entry.

public SepaBIC BIC { get; set; }

Property Value

SepaBIC

Remarks

This value should never be IsNull.

BankCode

The bank identification code of this entry.

public string BankCode { get; set; }

Property Value

string

Remarks

This is never null or empty.

BankName

The optional bank name, may be null if not known.

public string BankName { get; set; }

Property Value

string

CountryCode

The country code that of this entry.

public string CountryCode { get; set; }

Property Value

string

Remarks

This is never null or empty.

Methods

Adopt(SepaBankInfo)

Adopts all properties of the given bank information to this bank information.

public void Adopt(SepaBankInfo aBankInfo)

Parameters

aBankInfo SepaBankInfo

Another bank information that shall be incorporated into this bank information. This must not be null. The CountryCode and BankCode of that bank information must be equal to this bank information.

Remarks

Any non-null and non-empty properties of the other bank information will overwrite the current property values of this bank information.

Exceptions

ArgumentNullException

The parameter aBankInfo was null.

ArgumentException

The CountryCode or BankCode of this and the given SepaBankInfo were not equal.

CompareTo(SepaBankInfo)

public int CompareTo(SepaBankInfo aOtherBankInfo)

Parameters

aOtherBankInfo SepaBankInfo

Returns

int

FromJson(JsonObject)

Creates a new SepaBankInfo from a JSON object.

public static SepaBankInfo FromJson(JsonObject js)

Parameters

js JsonObject

The JSON object from which to get the attributes for the new SepaBankInfo instance. The field names of this JSON object must match the CSV header names. All fields values are treated as strings. If this parameter is null, then the return value will be null, too.

Returns

SepaBankInfo
See Also

GetAttribute(string)

Get an additional named attribute from this bank information record.

public string GetAttribute(string sAttrName)

Parameters

sAttrName string

The name of the attribute. This must not be null, or an empty string.

Returns

string

If the attribute exists, then its value is returned, which may be a null value or an empty string. If the attribute does not exist, then null is returned.

Exceptions

ArgumentNullException

The parameter sAttrName was null.

ArgumentException

The sAttrName was empty.

SetAttribute(string, string)

Adds another attribute value to this bank information.

public void SetAttribute(string sAttrName, string sAttrValue)

Parameters

sAttrName string

The name of the attribute. This must not be null, or an empty string. The name must be unique. An attribute with the same name cannot be added twice.

sAttrValue string

The attribute string value. If this is null or an empty string, then nothing will be added.

Exceptions

ArgumentNullException

The parameter sAttrName was null.

ArgumentException

The sAttrName was empty, or an attribute with that name was already added to this bank information.

ToJson()

Creates a JSON object with all attributes in this SepaBankInfo.

public JsonObject ToJson()

Returns

JsonObject

Remarks

The CSV header names are used as the JSON field names. All field values are JSON strings.

See Also

ToString()

public override string ToString()

Returns

string