Send feedback
Class StringEnumType<EnumT> (2.8.6)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.8.6 keyboard_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
Constructors
StringEnumType(Class<EnumT> clazz, ApiFunction<String,EnumT> constructor)
public StringEnumType ( Class<EnumT> clazz , ApiFunction<String , EnumT > constructor )
Parameters
Methods
createAndRegister(String constant)
public EnumT createAndRegister ( String constant )
Create a new constant and register it in the known values.
Parameter
Returns
valueOf(String constant)
public EnumT valueOf ( String constant )
Get the enum object for the given String constant, and allow unrecognized values.
Parameter
Returns
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
Returns
values()
Return the known values of this enum type.
Returns
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-03-05 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-03-05 UTC."],[],[]]