public final class DynamicEnum extends Object implements Iterable<DynamicEnum.Value>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
DynamicEnum.Builder
Builder for constructing new dynamic enums
|
static class |
DynamicEnum.Value
A value of a given enumeration.
|
Constructor and Description |
---|
DynamicEnum(Iterable<String> values)
Creates a new DynamicEnum.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
DynamicEnum.Value |
forName(String name)
Returns the Value that corresponds to the given name.
|
DynamicEnum.Value |
forOrdinal(int ordinal)
Returns the Value that corresponds to the given ordinal.
|
int |
hashCode() |
Iterator<DynamicEnum.Value> |
iterator()
Iterates over all the Values in the enumeration.
|
Set<String> |
names()
Returns the set of names.
|
List<String> |
namesList()
Returns the list of names.
|
int |
size()
Returns the number of values in the enumeration.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public DynamicEnum(Iterable<String> values)
values
- the values of this enumpublic DynamicEnum.Value forOrdinal(int ordinal)
ordinal
- The ordinal.ArrayIndexOutOfBoundsException
- If ordinal is not a valid ordinal.public DynamicEnum.Value forName(String name)
name
- The name.public Iterator<DynamicEnum.Value> iterator()
iterator
in interface Iterable<DynamicEnum.Value>
public Set<String> names()
public List<String> namesList()
public int size()
Copyright © 2021 Actian Corporation. All rights reserved.