FieldedText TypeScript Library
    Preparing search index...

    Class FtGenericField<T>Abstract

    Generic base class for typed fields. Provides type-safe value access and implements conversion methods.

    Type Parameters

    Hierarchy (View Summary)

    Index
    _valueAssigned: boolean = false
    quoted: boolean = false
    sequenceRedirectEvent: FtSequenceRedirectDelegate | undefined
    IGNORED_SEQUENCE_INVOKATION_DELAY: "AfterSequence" = FtSequenceInvokationDelay.AfterSequence
    NO_FIELDS_AFFECTED_INDEX: -1
    • get asBigInt(): bigint

      The field value as a bigint.

      Returns bigint

      FtFieldTypeError if the field is not of data type BigInt.

      FtFieldNullError if the field is null.

    • set asBigInt(value: bigint): void

      Parameters

      • value: bigint

      Returns void

    • get asBoolean(): boolean

      The field value as a boolean.

      Returns boolean

      FtFieldTypeError if the field is not of data type Boolean.

      FtFieldNullError if the field is null.

    • set asBoolean(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get asDateTime(): Date

      The field value as a DateTime.

      Returns Date

      FtFieldTypeError if the field is not of data type DateTime.

      FtFieldNullError if the field is null.

    • set asDateTime(value: Date): void

      Parameters

      • value: Date

      Returns void

    • get asDecimal(): number

      The field value as a number (decimal).

      Returns number

      FtFieldTypeError if the field is not of data type Decimal.

      FtFieldNullError if the field is null.

    • set asDecimal(value: number): void

      Parameters

      • value: number

      Returns void

    • get asFloat(): number

      The field value as a float.

      Returns number

      FtFieldTypeError if the field is not of data type Float.

      FtFieldNullError if the field is null.

    • set asFloat(value: number): void

      Parameters

      • value: number

      Returns void

    • get asInteger(): number

      The field value as an integer.

      Returns number

      FtFieldTypeError if the field is not of data type Integer.

      FtFieldNullError if the field is null.

    • set asInteger(value: number): void

      Parameters

      • value: number

      Returns void

    • get asNullableBigInt(): bigint | null

      The field value as a bigint or null.

      Returns bigint | null

      FtFieldTypeError if the field is not of data type BigInt.

    • set asNullableBigInt(value: bigint | null): void

      Parameters

      • value: bigint | null

      Returns void

    • get asNullableBoolean(): boolean | null

      The field value as a boolean or null.

      Returns boolean | null

      FtFieldTypeError if the field is not of data type Boolean.

    • set asNullableBoolean(value: boolean | null): void

      Parameters

      • value: boolean | null

      Returns void

    • get asNullableDateTime(): Date | null

      The field value as a Date or null.

      Returns Date | null

      FtFieldTypeError if the field is not of data type DateTime.

    • set asNullableDateTime(value: Date | null): void

      Parameters

      • value: Date | null

      Returns void

    • get asNullableDecimal(): number | null

      The field value as a number (decimal) or null.

      Returns number | null

      FtFieldTypeError if the field is not of data type Decimal.

    • set asNullableDecimal(value: number | null): void

      Parameters

      • value: number | null

      Returns void

    • get asNullableFloat(): number | null

      The field value as a float or null.

      Returns number | null

      FtFieldTypeError if the field is not of data type Float.

    • set asNullableFloat(value: number | null): void

      Parameters

      • value: number | null

      Returns void

    • get asNullableInteger(): number | null

      The field value as an integer or null.

      Returns number | null

      FtFieldTypeError if the field is not of data type BigInt.

    • set asNullableInteger(value: number | null): void

      Parameters

      • value: number | null

      Returns void

    • get asNullableString(): string | null

      The field value as a string or null.

      Returns string | null

      FtFieldTypeError if the field is not of data type String.

    • set asNullableString(value: string | null): void

      Parameters

      • value: string | null

      Returns void

    • get asString(): string

      The field value as a string.

      Returns string

      FtFieldTypeError if the field is not of data type String.

      FtFieldNullError if the field is null.

    • set asString(value: string): void

      Parameters

      • value: string

      Returns void

    • get nullableValue(): T | null

      The field value as an unspecified type or null.

      Use with caution, as this bypasses type safety. Ensure that the value being set is compatible with the field's expected type.

      Returns T | null

    • set nullableValue(value: T | null): void

      The field value as an unspecified type or null.

      Use with caution, as this bypasses type safety. Ensure that the value being set is compatible with the field's expected type.

      Parameters

      • value: T | null

      Returns void

    • get value(): T

      The field value as an unspecified type.

      When setting the value, the actual type must be compatible with the field's expected type.

      Returns T

      FtFieldNullError if the field is null.

    • set value(val: T): void

      The field value as an unspecified type.

      When setting the value, the actual type must be compatible with the field's expected type.

      Parameters

      • val: T

      Returns void

      FtFieldNullError if the field is null.

    • Formats the field value to a string.

      The formatting includes data type formatting but not text formatting such as quoting, padding, truncating etc. This formatted string typically is identical to the string value in the field's valueText property (unless the field value has been modified after loading).

      Returns string

    • Loads a heading into one of the field's heading lines.

      The heading is loaded according to the field's heading constraint.

      Parameters

      • idx: number

        Index of the heading to load.

      • headingText: string

        Text of the heading.

      Returns void

    • Loads the field headings from an array of strings.

      The headings are loaded according to the field's heading constraint. See loadHeading for more information.

      Parameters

      • value: string[]

        An array of headings. The length of the array should be equal to headingCount. Extra headings are ignored and missing headings are set to empty strings.

      Returns void

    • Loads the field value from its formatted text representation.

      Parameters

      • valueText: string

        Formatted text representation of field value. Formatting only includes data type formatting and not text formatting such as quoting, padding, truncating etc.

      Returns void

    • Sets the field value to null.

      Checks for sequence redirects that may be triggered by setting the field to null.

      Returns number

      If this setting of field to null caused a sequence redirect, returns the index of the first field affected by the redirect. If no redirect occurred, returns FtField.NO_FIELDS_AFFECTED_INDEX.

      Error if the field is constant and cannot be set to null.