Interface EnumValue


public interface EnumValue
When creating an Annotation, we may need to create an enum value without access to the enumeration.

In such a case, you can use this type when calling Annotation.BuilderBase.putValue(String, Object)

  • Method Summary

    Modifier and Type
    Method
    Description
    static EnumValue
    create(TypeName enumType, String enumName)
    Create a new enum value, when the enum is not available on classpath.
    static <T extends Enum<T>>
    EnumValue
    create(Class<T> type, T value)
    Create a new enum value.
    The enum value.
    Type of the enumeration.
  • Method Details

    • create

      static EnumValue create(TypeName enumType, String enumName)
      Create a new enum value, when the enum is not available on classpath.
      Parameters:
      enumType - type of the enumeration
      enumName - value of the enumeration
      Returns:
      enum value
    • create

      static <T extends Enum<T>> EnumValue create(Class<T> type, T value)
      Create a new enum value.
      Type Parameters:
      T - type of the enum
      Parameters:
      type - enum type
      value - enum value constant
      Returns:
      new enum value
    • type

      TypeName type()
      Type of the enumeration.
      Returns:
      type name of the enumeration
    • name

      String name()
      The enum value.
      Returns:
      enum value