Class StringEnumType<EnumT> (2.3.5)

public class StringEnumType<EnumT>

This represents a concept having a known set of acceptable String values, which can expand later due to new API features.

Inheritance

java.lang.Object > StringEnumType<EnumT>

Type Parameter

NameDescription
EnumT

Constructors

StringEnumType(Class<EnumT> clazz, ApiFunction<String,EnumT> constructor)

public StringEnumType(Class<EnumT> clazz, ApiFunction<String,EnumT> constructor)
Parameters
NameDescription
clazzClass<EnumT>
constructorApiFunction<String,EnumT>

Methods

createAndRegister(String constant)

public EnumT createAndRegister(String constant)

Create a new constant and register it in the known values.

Parameter
NameDescription
constantString
Returns
TypeDescription
EnumT

valueOf(String constant)

public EnumT valueOf(String constant)

Get the enum object for the given String constant, and allow unrecognized values.

Parameter
NameDescription
constantString
Returns
TypeDescription
EnumT

valueOfStrict(String constant)

public EnumT valueOfStrict(String constant)

Get the enum object for the given String constant, and throw an exception if the constant is not recognized.

Parameter
NameDescription
constantString
Returns
TypeDescription
EnumT

values()

public EnumT[] values()

Return the known values of this enum type.

Returns
TypeDescription
EnumT[]