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

  • 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

_entity: EntityT
_entityConstructor: Constructable<EntityT, unknown>
_fieldName: string
_fieldOf: ConstructorOrField<EntityT, any>
_fieldOptions: Required<FieldOptions<NullableT, SelectableT>>
deprecated

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

enumType?: Record<string, EnumT>

Methods

  • 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(): string
  • Gets the path to the complex type property represented by this.

    Returns string

    The path to the complex type property.

  • 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 Ⓒ 2023 SAP SE or an SAP affiliate company. All rights reserved.