AccountName

public struct AccountName : AccountItem
extension AccountName: Equatable
extension AccountName: CustomStringConvertible
extension AccountName: Hashable

Struct with represents just the name of an Account

  • Full quilified name of the account, e.g. Assets:Cash:CAD

    Declaration

    Swift

    public let fullName: String
  • Type, see AccountType

    Declaration

    Swift

    public let accountType: AccountType
  • Last part of the name, for Assets:Cash:CAD this would be CAD

    Declaration

    Swift

    public var nameItem: String { get }
  • Creates an Account Name

    Throws

    AccountNameError.invaildName in case the account name is invalid

    Declaration

    Swift

    public init(_ name: String) throws

    Parameters

    name

    a vaild name for the account

  • Checks if a given name for an account is valid

    This includes that the name start with one of the base groups and is correctly formattet with seperators

    Declaration

    Swift

    public static func isNameValid(_ name: String) -> Bool

    Parameters

    name

    String to check

    Return Value

    if the name is valid

  • Compare the full name of the two Account names.

    Declaration

    Swift

    public static func == (lhs: AccountName, rhs: AccountName) -> Bool

    Return Value

    if the account names are equal

  • Declaration

    Swift

    public var description: String { get }
  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)