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