Send feedback
Class StringEnumType<EnumT> (2.33.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.33.0keyboard_arrow_down
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.
Type Parameter
Name
Description
EnumT
Constructors
StringEnumType(Class<EnumT> clazz, ApiFunction<String,EnumT> constructor)
public StringEnumType ( Class<EnumT> clazz , ApiFunction<String , EnumT > constructor )
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()
Return the known values of this enum type.
Returns
Type
Description
EnumT []
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-15 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-15 UTC."],[],[]]