org.rrd4j.core

## Class RrdEnum<U extends RrdUpdater<U>,E extends Enum<E>>

- java.lang.Object
- - org.rrd4j.core.RrdPrimitive<U>
  - - org.rrd4j.core.RrdEnum<U,E>

- Type Parameters:
    `U` - The type of RrdUpdater this primitive belongs to
    `E` - The enum type being stored

      class RrdEnum<U extends RrdUpdater<U>,E extends Enum<E>>
      extends RrdPrimitive<U>

  RRD primitive type for handling enum values.

  This class provides methods to store and retrieve enum values in RRD files. It handles the conversion between enum constants and their string representations, with caching support for performance optimization.

- - ### Field Summary

    - ### Fields inherited from class org.rrd4j.core.RrdPrimitive

      `RRD_DOUBLE, RRD_INT, RRD_LONG, RRD_PRIM_SIZES, RRD_STRING, STRING_LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RrdEnum(RrdUpdater<U> updater, boolean isConstant, Class<E> clazz)`
    `RrdEnum(RrdUpdater<U> updater, Class<E> clazz)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) E` | `get()` Gets the enum value.
    `(package private) String` | `name()` Gets the name of the enum value.
    `(package private) void` | `set(E value)` Sets the enum value.

    - ### Methods inherited from class org.rrd4j.core.RrdPrimitive

      `isCachingAllowed, readBytes, readDouble, readDouble, readDouble, readEnum, readInt, readLong, readString, writeBytes, writeDouble, writeDouble, writeDouble, writeDouble, writeEnum, writeInt, writeLong, writeString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RrdEnum

          RrdEnum(RrdUpdater<U> updater,
                  boolean isConstant,
                  Class<E> clazz)

    - #### RrdEnum

          RrdEnum(RrdUpdater<U> updater,
                  Class<E> clazz)

  - ### Method Detail

    - #### get

          E get()
          throws IOException

      Gets the enum value.
      Returns:
        the enum value
      Throws:
        `IOException` - if an I/O error occurs

    - #### name

          String name()
               throws IOException

      Gets the name of the enum value.
      Returns:
        the name of the enum value
      Throws:
        `IOException` - if an I/O error occurs

    - #### set

          void set(E value)
            throws IOException

      Sets the enum value.
      Parameters:
        `value` - the enum value to set
      Throws:
        `IOException` - if an I/O error occurs