@InternalApi public class StringEnumType<EnumT> extends Object
Constructor and Description |
---|
StringEnumType(Class<EnumT> clazz,
ApiFunction<String,EnumT> constructor) |
Modifier and Type | Method and Description |
---|---|
EnumT |
createAndRegister(String constant)
Create a new constant and register it in the known values.
|
EnumT |
valueOf(String constant)
Get the enum object for the given String constant, and allow unrecognized values.
|
EnumT |
valueOfStrict(String constant)
Get the enum object for the given String constant, and throw an exception if the constant is
not recognized.
|
EnumT[] |
values()
Return the known values of this enum type.
|
public StringEnumType(Class<EnumT> clazz, ApiFunction<String,EnumT> constructor)
public EnumT createAndRegister(String constant)
public EnumT valueOfStrict(String constant)
public EnumT valueOf(String constant)
public EnumT[] values()
Copyright © 2019 Google LLC. All rights reserved.