java.lang.Object
org.rrd4j.core.RrdPrimitive<U>
org.rrd4j.core.RrdString<U>
Type Parameters:
U - The type of RrdUpdater this primitive belongs to

class RrdString<U extends RrdUpdater<U>>extends RrdPrimitive<U>
RRD primitive type for handling string values.

This class provides methods to store and retrieve string values in RRD files. It includes caching support for performance optimization when the backend allows it.

  • Field Details

    • cache

      private String cache
      The last value read, when caching is enabled.
  • Constructor Details

    • RrdString

      RrdString(RrdUpdater<U> updater, boolean isConstant)
      Create a string-valued primitive.
      Parameters:
      updater - the source of values
      isConstant - true to read a constant rather than a varying value
    • RrdString

      RrdString(RrdUpdater<U> updater)
      Create a varying string-valued primitive.
      Parameters:
      updater - the source of values
  • Method Details

    • set

      void set(String value) throws IOException
      Store a string value with optional caching.
      Parameters:
      value - the string value to set
      Throws:
      IOException - if an I/O error occurs
    • get

      String get() throws IOException
      Retrieve the stored string value.
      Returns:
      the stored string
      Throws:
      IOException - if an I/O error occurs