Struct SepaCreditorID
Helper class for working with a SEPA Creditor Identifier.
Inherited Members
Namespace: Subsembly.Sepa
Assembly: Subsembly.Sepa.dll
Syntax
public struct SepaCreditorID
Constructors
SepaCreditorID(String)
Declaration
public SepaCreditorID(string sCreditorID)
Parameters
Type | Name | Description |
---|---|---|
System.String | sCreditorID | The creditor ID. If this is |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The given creditor ID string was not a syntactically correct creditor ID (i.e.
IsValid(String) returns |
Fields
MAXLENGTH
The maximum length of any creditor identifier.
Declaration
public const int MAXLENGTH = 35
Field Value
Type | Description |
---|---|
System.Int32 |
MINLENGTH
The minimum length of any creditor identifier.
Declaration
public const int MINLENGTH = 8
Field Value
Type | Description |
---|---|
System.Int32 |
Null
Represents an unset SepaCreditorID instance.
Declaration
public static readonly SepaCreditorID Null
Field Value
Type | Description |
---|---|
SepaCreditorID |
Properties
CountryCode
Provides the country code portion of this SEPA Creditor Identifier.
Declaration
public readonly string CountryCode { get; }
Property Value
Type | Description |
---|---|
System.String |
CreditorID
Provides the wrapped SEPA Creditor Identifier.
Declaration
public readonly string CreditorID { get; }
Property Value
Type | Description |
---|---|
System.String |
IsNull
Indicates whether this SEPA Creditor Identifier is Null.
Declaration
public readonly bool IsNull { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Capture(String)
Captures a creditor ID entered by the user, removing whitespace and converting lower case to upper case.
Declaration
public static string Capture(string sCreditorId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sCreditorId |
Returns
Type | Description |
---|---|
System.String | If the parameter sCreditorId was |
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.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Right hand side to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if both are essentially the same SEPA Creditor Identifier. |
Overrides
Format(String)
Nicely formats the given creditor ID input into groups.
Declaration
public static string Format(string sCreditorId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sCreditorId |
Returns
Type | Description |
---|---|
System.String |
GetCountryCode(String)
Returns the country code portion of the given SEPA Creditor Identifier.
Declaration
public static string GetCountryCode(string sCreditorID)
Parameters
Type | Name | Description |
---|---|---|
System.String | sCreditorID | The creditor ID to extract the country code from. |
Returns
Type | Description |
---|---|
System.String | If the given creditor ID was |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The given creditor ID was not a valid string. |
GetHashCode()
Provides an hash code based on the SEPA Creditor Identifier.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hashcode. |
Overrides
IsValid(String)
Tests whether a string is a valid SEPA Creditor Identifier.
Declaration
public static bool IsValid(string sCreditorID)
Parameters
Type | Name | Description |
---|---|---|
System.String | sCreditorID |
Returns
Type | Description |
---|---|
System.Boolean |
SameCreditor(SepaCreditorID, SepaCreditorID)
Compares the given creditor IDs without the contained creditor business code.
Declaration
public static bool SameCreditor(SepaCreditorID tCreditorID1, SepaCreditorID tCreditorID2)
Parameters
Type | Name | Description |
---|---|---|
SepaCreditorID | tCreditorID1 | |
SepaCreditorID | tCreditorID2 |
Returns
Type | Description |
---|---|
System.Boolean |
SameCreditor(String, String)
Compares the given creditor IDs without the contained creditor business code.
Declaration
public static bool SameCreditor(string sCreditorID1, string sCreditorID2)
Parameters
Type | Name | Description |
---|---|---|
System.String | sCreditorID1 | |
System.String | sCreditorID2 |
Returns
Type | Description |
---|---|
System.Boolean |
ToString()
Returns the SEPA Creditor Identifier.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | SEPA Creditor Identifier. |
Overrides
Operators
Equality(SepaCreditorID, SepaCreditorID)
Equality operator compares the SEPA Creditor Identifier.
Declaration
public static bool operator ==(SepaCreditorID lhs, SepaCreditorID rhs)
Parameters
Type | Name | Description |
---|---|---|
SepaCreditorID | lhs | |
SepaCreditorID | rhs |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(SepaCreditorID, SepaCreditorID)
Inequality operator compares the SEPA Creditor Identifier.
Declaration
public static bool operator !=(SepaCreditorID lhs, SepaCreditorID rhs)
Parameters
Type | Name | Description |
---|---|---|
SepaCreditorID | lhs | |
SepaCreditorID | rhs |
Returns
Type | Description |
---|---|
System.Boolean |