Class StringEnumType<EnumT> (2.36.1)
Stay organized with collections
Save and categorize content based on your preferences.
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[] | |
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 2024-05-09 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]