Top "Enums" questions

A data type consisting of a set of named values called elements, members or enumerators of the type.

Check if value exists in enum in TypeScript

I recieve a number type = 3 and have to check if it exists in this enum: export const MESSAGE_TYPE = { INFO: 1, …

javascript typescript enums
Convert objective-c typedef to its string equivalent

Assuming that I have a typedef declared in my .h file as such: typedef enum { JSON, XML, Atom, RSS } FormatType; …

c objective-c enums typedef
Adding a new value to an existing ENUM Type

I have a table column that uses an enum type. I wish to update that enum type to have an …

database postgresql enums
Convert String to equivalent Enum value

Is it possible for me to convert a String to an equivalent value in an Enumeration, using Java. I can …

java enums
How to get all enum values in Java?

I came across this problem that I without knowing the actual enum type I need to iterate its possible values. …

java enums
What is the difference between `Enum.name()` and `Enum.toString()`?

After reading the documentation of String java.lang.Enum.name() I am not sure I understand when to use name() …

java enums
Is there a simple way to convert C++ enum to string?

Suppose we have some named enums: enum MyEnum { FOO, BAR = 0x50 }; What I googled for is a script (any language) …

c++ string enums scripting
Implementing Singleton with an Enum (in Java)

I have read that it is possible to implement Singleton in Java using an Enum such as: public enum MySingleton { …

java design-patterns enums singleton
What's the advantage of a Java enum versus a class with public static final fields?

I am very familiar with C# but starting to work more in Java. I expected to learn that enums in …

java enums
TypeScript enum to object array

I have an enum defined this way: export enum GoalProgressMeasurements { Percentage = 1, Numeric_Target = 2, Completed_Tasks = 3, Average_Milestone_Progress = 4, Not_Measured = 5 } …

javascript arrays typescript enums casting