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 Details

  • Method Details

    • fromString

      protected static <T extends ExpandableStringEnum<T>> T fromString(String name, Class<T> clazz)
      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

      protected static <T extends ExpandableStringEnum<T>> Collection<T> values(Class<T> clazz)
      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

      public String toString()
      Overrides:
      toString in class Object
    • getValue

      public String getValue()
      Description copied from interface: ExpandableEnum
      Returns the value represented by this expandable enum instance.
      Specified by:
      getValue in interface ExpandableEnum<T extends ExpandableStringEnum<T>>
      Returns:
      The value represented by this expandable enum instance.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object