Home Reference Source
import Enum from '~/models/Enum.js'
public class | source

Enum

Implements:

  • JSONSerializable

Represents an enumeration

Static Method Summary

Static Public Methods
public static

fromJSON(json: Object): Enum

Converts from Python JSON to enumeration

Constructor Summary

Public Constructor
public

constructor(object: Object)

Creates an enum from an object of Key/ Value pairs

Method Summary

Public Methods
public

descriptionForValue(value: any)

Attempts to create human-readable name from enum key.

public

keyForValue(value: any)

Obtains key name for value (camel case)

Static Public Methods

public static fromJSON(json: Object): Enum source

Converts from Python JSON to enumeration

Params:

NameTypeAttributeDescription
json Object

Return:

Enum

Public Constructors

public constructor(object: Object) source

Creates an enum from an object of Key/ Value pairs

Params:

NameTypeAttributeDescription
object Object

key to raw value. Keys should be camelCase should also be plain object not checked for inheritance.

Public Methods

public descriptionForValue(value: any) source

Attempts to create human-readable name from enum key.

Params:

NameTypeAttributeDescription
value any

The enum value

public keyForValue(value: any) source

Obtains key name for value (camel case)

Params:

NameTypeAttributeDescription
value any

The enum value