public abstract class PEnumDescriptor<T extends PEnumValue<T>> extends PDeclaredDescriptor<T>
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FIRST_VALUE |
Constructor and Description |
---|
PEnumDescriptor(String packageName,
String name,
Supplier<PEnumBuilder<T>> provider) |
Modifier and Type | Method and Description |
---|---|
PEnumBuilder<T> |
builder()
Get the builder for the given declared type.
|
boolean |
equals(Object o) |
abstract T |
findById(int id) |
abstract T |
findByName(String name) |
protected Supplier<PEnumBuilder<T>> |
getBuilderSupplier() |
PType |
getType() |
abstract T[] |
getValues() |
int |
hashCode() |
String |
toString() |
T |
valueForId(int id) |
T |
valueForName(String name) |
getDefaultValue, getName, getProgramName, getQualifiedName
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getQualifiedName
public static final int DEFAULT_FIRST_VALUE
public PEnumDescriptor(String packageName, String name, Supplier<PEnumBuilder<T>> provider)
@Nullable public abstract T findById(int id)
id
- Value to look up enum from.@Nullable public abstract T findByName(String name)
name
- Name to look up enum from.@Nonnull public T valueForId(int id)
id
- Value to look up enum from.IllegalArgumentException
- If value not found.@Nonnull public T valueForName(String name)
name
- Name to look up enum from.IllegalArgumentException
- If value not found.@Nonnull public PEnumBuilder<T> builder()
PDeclaredDescriptor
builder
in class PDeclaredDescriptor<T extends PEnumValue<T>>
public String toString()
toString
in class PDeclaredDescriptor<T extends PEnumValue<T>>
protected Supplier<PEnumBuilder<T>> getBuilderSupplier()
Copyright © 2015–2017 morimekta.net. All rights reserved.