Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractRecordModel

Abstract base class for RecordModelImpl and MutableRecordModelImpl.

This class implements all methods of the RecordModel interface but introduces the abstract model method. *

Hierarchy

  • AbstractRecordModel

Implements

Index

Constructors

constructor

  • Create an AbstractRecordModel

    Parameters

    • recordV2Constructor: object

      a constructor function for creating RecordV2 implementations

    • schema: ConcreteSchema

      the schema that this model corresponds to

    Returns AbstractRecordModel

Properties

Private modelSchema

modelSchema: ConcreteSchema

The schema that this model corresponds to

Private recordV2Constructor

recordV2Constructor: object

A constructor function for creating RecordV2 implementations

Type declaration

Methods

asValue

  • Creates an immutable RecordV2 object generated from the model.

    Returns RecordV2

    a new immutable instance

fieldCount

  • fieldCount(recordName: string, recordIndex: number, fieldName: string): number
  • inheritdoc

    Parameters

    • recordName: string
    • recordIndex: number
    • fieldName: string

    Returns number

get

  • get(recordName: string, recordIndexOrFieldName?: string | number, fieldNameOrFieldIndex?: string | number, fieldIndex?: number): string | null
  • inheritdoc

    Parameters

    • recordName: string
    • Default value recordIndexOrFieldName: string | number = 0
    • Optional fieldNameOrFieldIndex: string | number
    • Default value fieldIndex: number = 0

    Returns string | null

Protected getRecord

  • Get the model data for a record

    Parameters

    • schemaRecord: RecordImpl

      the record for which to get the data

    • index: number

      the index of the record

    Returns RecordData

    model data of the record

Abstract model

  • Get the model data

    Returns RecordData[]

    the model data

Protected parseKey

  • Convert a textual representation of a record entry to a record key

    Parameters

    • key: string

      the key string

    Returns RecordKey

    the parsed record key

Protected parseKeyPart

  • parseKeyPart(keyPart: string): Array<string | number>
  • Parse the field name and index part of a record key

    Parameters

    • keyPart: string

      the part of the key containing the field name and index

    Returns Array<string | number>

    an array containing the field name and the field index

recordCount

  • recordCount(recordName: string): any
  • Returns the actual number of occurrences of a named record.

    If the record is not variable, this is the same as the defined number of occurrences in the schema

    Parameters

    • recordName: string

    Returns any

    the actual number of occurrences of the record

Protected schema

  • Get the schema that this model corresponds to

    Returns ConcreteSchema