Now on: joopl.Enum
Represents an utility class to work with enumerations.
Methods
parseName
(
static
-
enumType
-
valueName
Parses a text into a given enumeration value
Parameters:
-
enumType
EnumThe enumeration definition (i.e. State, ConnectionTypes, ...)
-
valueName
StringThe value name to be parsed (i.e. If an enumeration called States would have an open and closed values, open or closed would be a value names)
Example:
$namespace.using("joopl", function(joopl) {
joopl.declareEnum("State", {
open: 1,
closed: 2
});
var open = joopl.Enum.parseName(State, "open")
});
parseNames
(
static
-
enumType
-
valueNames
Parses a comma-separated list of text values as a mask of given enumeration
Parameters:
-
enumType
EnumThe enumeration definition (i.e. State, ConnectionTypes, ...)
-
valueNames
StringA comma-separated list of a mask of given enumeration type (i.e. "open, closed, working").
Example:
$namespace.using("joopl", function(joopl) {
joopl.declareEnum("State", {
open: 1,
closed: 2
});
joopl.Enum.parseNames(State, "open, closed")
});