Class StringEnumType<EnumT> (2.38.0)

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

Name Description
EnumT

Constructors

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

public StringEnumType(Class<EnumT> clazz, ApiFunction<String,EnumT> constructor)
Parameters
Name Description
clazz Class<EnumT>
constructor ApiFunction<String,EnumT>

Methods

createAndRegister(String constant)

public EnumT createAndRegister(String constant)

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

Parameter
Name Description
constant String
Returns
Type Description
EnumT

valueOf(String constant)

public EnumT valueOf(String constant)

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

Parameter
Name Description
constant String
Returns
Type Description
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
Name Description
constant String
Returns
Type Description
EnumT

values()

public EnumT[] values()

Return the known values of this enum type.

Returns
Type Description
EnumT[]