Enumeration Class

Beta  

A Typescript class representation of an ECEnumeration.

Extends

Methods

Name Description
constructor(schema: Schema, name: string, primitiveType?: Integer | String): Enumeration    
addEnumerator(enumerator: AnyEnumerator): void Protected Adds enumerator to list of enumerators on this Enumeration  
createEnumerator(name: string, value: string | number, label?: string, description?: string): AnyEnumerator Creates an Enumerator with the provided name and value as well as optional parameters label and description  
fromJSON(enumerationProps: EnumerationProps): Promise<void>    
fromJSONSync(enumerationProps: EnumerationProps): void    
getEnumerator(value: string): undefined | Enumerator<string> Gets an enumerator that matches the value provided.  
getEnumerator(value: number): undefined | Enumerator<number>    
getEnumeratorByName(name: string): undefined | AnyEnumerator Gets an enumerator that matches the name provided.  
toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): EnumerationProps Save this Enumeration's properties to an object for serializing to JSON.  

Inherited methods

Name Inherited from Description
equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItem | SchemaItemKey): boolean Static SchemaItem Indicates if the two SchemaItem objects are equal by comparing their respective SchemaItem.key properties.
parseFullName(fullName: string): [string, string] Static SchemaItem Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.

Properties

Name Type Description
_enumerators Protected AnyEnumerator[]    
_isStrict Protected boolean    
_type Protected Integer | String    
enumerators Accessor ReadOnly AnyEnumerator[]    
isInt Accessor ReadOnly boolean    
isStrict Accessor ReadOnly boolean    
isString Accessor ReadOnly boolean    
schemaItemType Readonly Enumeration    
type Accessor ReadOnly undefined | Integer | String    

Inherited properties

Name Type Inherited from Description
_description Protected undefined | string SchemaItem  
_key Protected SchemaItemKey SchemaItem  
_label Protected undefined | string SchemaItem  
description Accessor ReadOnly undefined | string SchemaItem  
fullName Accessor ReadOnly string SchemaItem  
key Accessor ReadOnly SchemaItemKey SchemaItem  
label Accessor ReadOnly undefined | string SchemaItem  
name Accessor ReadOnly string SchemaItem  
schema Readonly Schema SchemaItem  

Defined in

Last Updated: 12 June, 2024