Package com.azure.core.util
Class ExpandableStringEnum<T extends ExpandableStringEnum<T>>
java.lang.Object
com.azure.core.util.ExpandableStringEnum<T>
- Type Parameters:
T- a specific expandable enum type
- All Implemented Interfaces:
ExpandableEnum<String>
- Direct Known Subclasses:
AzureCloud,CloudEventDataFormat,GeoObjectType,HttpHeaderName,LongRunningOperationStatus
public abstract class ExpandableStringEnum<T extends ExpandableStringEnum<T>>
extends Object
implements ExpandableEnum<String>
Base implementation for expandable, single string enums.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected static <T extends ExpandableStringEnum<T>>
TfromString(String name, Class<T> clazz) Creates an instance of the specific expandable string enum from a String.getValue()Returns the value represented by this expandable enum instance.inthashCode()toString()protected static <T extends ExpandableStringEnum<T>>
Collection<T> Gets a collection of all known values to an expandable string enum type.
-
Constructor Details
-
ExpandableStringEnum
Deprecated.Use thefromString(String, Class)factory method.Creates a new instance ofExpandableStringEnumwithout atoString()value.This constructor shouldn't be called as it will produce a
ExpandableStringEnumwhich doesn't have a String enum value.
-
-
Method Details
-
fromString
Creates an instance of the specific expandable string enum from a String.- Type Parameters:
T- the class of the expandable string enum.- Parameters:
name- The value to create the instance from.clazz- The class of the expandable string enum.- Returns:
- The expandable string enum instance.
- Throws:
RuntimeException- wrapping implementation class constructor exception (if any is thrown).
-
values
Gets a collection of all known values to an expandable string enum type.- Type Parameters:
T- the class of the expandable string enum.- Parameters:
clazz- the class of the expandable string enum.- Returns:
- A collection of all known values for the given
clazz.
-
toString
-
getValue
Description copied from interface:ExpandableEnumReturns the value represented by this expandable enum instance.- Specified by:
getValuein interfaceExpandableEnum<T extends ExpandableStringEnum<T>>- Returns:
- The value represented by this expandable enum instance.
-
hashCode
public int hashCode() -
equals
-
fromString(String, Class)factory method.