Class EnumRef

java.lang.Object
org.apache.cayenne.exp.EnumRef

public final class EnumRef extends Object
An enum constant referenced by the names of its class and constant, as parsed from the "enum:" literal of an expression String. It is resolved to the constant on access, so that an expression can be parsed and printed in an environment where the enum class is not available, e.g. in the Modeler.
Since:
5.0
  • Constructor Details

    • EnumRef

      public EnumRef(String className, String enumName)
  • Method Details

    • getClassName

      public String getClassName()
    • getEnumName

      public String getEnumName()
    • resolve

      public Enum<?> resolve()
      Loads the enum class and returns the referenced constant.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Returns the "enum:" literal of the constant, as it appears in an expression String.
      Overrides:
      toString in class Object