Struct SepaCreditorID

Namespace
Subsembly.Sepa
Assembly
Subsembly.Sepa.dll

Helper class for working with a SEPA Creditor Identifier.

public struct SepaCreditorID
Inherited Members

Constructors

SepaCreditorID(string)

public SepaCreditorID(string sCreditorID)

Parameters

sCreditorID string

The creditor ID. If this is null or an empty string, then this will be a Null creditor ID. Use Capture(string) in order to pre-process a user entered creditor ID.

Exceptions

ArgumentException

The given creditor ID string was not a syntactically correct creditor ID (i.e. IsValid(string) returns false on it.

Fields

MAXLENGTH

The maximum length of any creditor identifier.

public const int MAXLENGTH = 35

Field Value

int

MINLENGTH

The minimum length of any creditor identifier.

public const int MINLENGTH = 8

Field Value

int

Null

Represents an unset SepaCreditorID instance.

public static readonly SepaCreditorID Null

Field Value

SepaCreditorID

Properties

CountryCode

Provides the country code portion of this SEPA Creditor Identifier.

public string CountryCode { get; }

Property Value

string

CreditorID

Provides the wrapped SEPA Creditor Identifier.

public string CreditorID { get; }

Property Value

string

IsNull

Indicates whether this SEPA Creditor Identifier is Null.

public bool IsNull { get; }

Property Value

bool

Methods

Capture(string)

Captures a creditor ID entered by the user, removing whitespace and converting lower case to upper case.

public static string Capture(string sCreditorId)

Parameters

sCreditorId string

Returns

string

If the parameter sCreditorId was null or an empty string, then the return value will be null.

Remarks

Any non alphanumeric characters, such as whitespace or symbols, are removed from the captured creditor ID.

Any lower case letters are converted into upper case letters.

IsValid(string)

Equals(object)

Compares the SEPA Creditor Identifier for equivalence.

public override bool Equals(object obj)

Parameters

obj object

Right hand side to compare to.

Returns

bool

True if both are essentially the same SEPA Creditor Identifier.

Format(string)

Nicely formats the given creditor ID input into groups.

public static string Format(string sCreditorId)

Parameters

sCreditorId string

Returns

string

GetCountryCode(string)

Returns the country code portion of the given SEPA Creditor Identifier.

public static string GetCountryCode(string sCreditorID)

Parameters

sCreditorID string

The creditor ID to extract the country code from.

Returns

string

If the given creditor ID was null or an empty string, then null is returned. Otherwise the first two characters from the string are returned.

Exceptions

ArgumentException

The given creditor ID was not a valid string.

GetHashCode()

Provides an hash code based on the SEPA Creditor Identifier.

public override int GetHashCode()

Returns

int

Hashcode.

IsValid(string)

Tests whether a string is a valid SEPA Creditor Identifier.

public static bool IsValid(string sCreditorID)

Parameters

sCreditorID string

Returns

bool

SameCreditor(SepaCreditorID, SepaCreditorID)

Compares the given creditor IDs without the contained creditor business code.

public static bool SameCreditor(SepaCreditorID tCreditorID1, SepaCreditorID tCreditorID2)

Parameters

tCreditorID1 SepaCreditorID
tCreditorID2 SepaCreditorID

Returns

bool

SameCreditor(string, string)

Compares the given creditor IDs without the contained creditor business code.

public static bool SameCreditor(string sCreditorID1, string sCreditorID2)

Parameters

sCreditorID1 string
sCreditorID2 string

Returns

bool

ToString()

Returns the SEPA Creditor Identifier.

public override string ToString()

Returns

string

SEPA Creditor Identifier.

Operators

operator ==(SepaCreditorID, SepaCreditorID)

Equality operator compares the SEPA Creditor Identifier.

public static bool operator ==(SepaCreditorID lhs, SepaCreditorID rhs)

Parameters

lhs SepaCreditorID
rhs SepaCreditorID

Returns

bool

operator !=(SepaCreditorID, SepaCreditorID)

Inequality operator compares the SEPA Creditor Identifier.

public static bool operator !=(SepaCreditorID lhs, SepaCreditorID rhs)

Parameters

lhs SepaCreditorID
rhs SepaCreditorID

Returns

bool