001package io.prometheus.metrics.core.datapoints;
002
003/**
004 * Represents a single StateSet data point.
005 *
006 * <p>See JavaDoc of {@link CounterDataPoint} on how using data points directly can improve
007 * performance.
008 */
009public interface StateSetDataPoint extends DataPoint {
010
011  /**
012   * {@code state} must be one of the states from when the {@code StateSet} was created with {@link
013   * io.prometheus.metrics.core.metrics.StateSet.Builder#states(String...)}.
014   */
015  void setTrue(String state);
016
017  /**
018   * {@code state} must be one of the states from when the {@code StateSet} was created with {@link
019   * io.prometheus.metrics.core.metrics.StateSet.Builder#states(Class)}.
020   */
021  default void setTrue(Enum<?> state) {
022    setTrue(state.toString());
023  }
024
025  /**
026   * {@code state} must be one of the states from when the {@code StateSet} was created with {@link
027   * io.prometheus.metrics.core.metrics.StateSet.Builder#states(String...)}.
028   */
029  void setFalse(String state);
030
031  /**
032   * {@code state} must be one of the states from when the {@code StateSet} was created with {@link
033   * io.prometheus.metrics.core.metrics.StateSet.Builder#states(Class)}.
034   */
035  default void setFalse(Enum<?> state) {
036    setFalse(state.toString());
037  }
038}