Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EnumField<EntityT, EnumT, NullableT, SelectableT>

Represents a property with an enum value.

Type parameters

  • EntityT: EntityBase

    Type of the entity the field belongs to.

  • EnumT: string = string

    Enum type that contains all valid enum entries for this field.

  • NullableT: boolean = false

    Boolean type that represents whether the field is nullable.

  • SelectableT: boolean = false

    Boolean type that represents whether the field is selectable.

Hierarchy

  • Field<EntityT, NullableT, SelectableT>
    • EnumField

Index

Constructors

constructor

  • new EnumField<EntityT, EnumT, NullableT, SelectableT>(fieldName: string, _fieldOf: ConstructorOrField<EntityT, any>, enumType?: Record<string, EnumT>, fieldOptions?: FieldOptions<NullableT, SelectableT>): EnumField<EntityT, EnumT, NullableT, SelectableT>
  • Creates an instance of EnumField.

    Type parameters

    • EntityT: EntityBase<EntityT>

    • EnumT: string = string

    • NullableT: boolean = false

    • SelectableT: boolean = false

    Parameters

    • fieldName: string

      Actual name of the field used in the OData request.

    • _fieldOf: ConstructorOrField<EntityT, any>

      The constructor of the entity or the complex type field this field belongs to.

    • Optional enumType: Record<string, EnumT>

      Enum type of the field according to the metadata description.

    • Optional fieldOptions: FieldOptions<NullableT, SelectableT>

      Optional settings for this field.

    Returns EnumField<EntityT, EnumT, NullableT, SelectableT>

Properties

Readonly _entity

_entity: EntityT

Readonly _entityConstructor

_entityConstructor: Constructable<EntityT, unknown>

Readonly _fieldName

_fieldName: string

Readonly _fieldOf

_fieldOf: ConstructorOrField<EntityT, any>

Readonly _fieldOptions

_fieldOptions: Required<FieldOptions<NullableT, SelectableT>>

Readonly edmType

deprecated

Since v1.48.0. This property is not used anymore.

Optional Readonly enumType

enumType?: Record<string, EnumT>

Methods

equals

  • equals(value: `${EnumT}`): Filter<EntityT, string>
  • Creates an instance of Filter for this field and the given value using the operator 'eq', i.e. ==.

    Parameters

    • value: `${EnumT}`

      Value to be used in the filter

    Returns Filter<EntityT, string>

    The resulting filter

fieldPath

  • fieldPath(): string
  • Gets the path to the complex type property represented by this.

    Returns string

    The path to the complex type property.

notEquals

  • notEquals(value: `${EnumT}`): Filter<EntityT, string>
  • Creates an instance of Filter for this field and the given value using the operator 'ne', i.e. !=.

    Parameters

    • value: `${EnumT}`

      Value to be used in the filter

    Returns Filter<EntityT, string>

    The resulting filter

    Copyright Ⓒ 2021 SAP SE or an SAP affiliate company. All rights reserved.