All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.counter.api.CounterState Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.counter.api;

import org.infinispan.commons.marshall.ProtoStreamTypeIds;
import org.infinispan.protostream.annotations.ProtoEnumValue;
import org.infinispan.protostream.annotations.ProtoTypeId;

/**
 * The possible states for a counter value.
 *
 * @author Pedro Ruivo
 * @since 9.0
 */
@ProtoTypeId(ProtoStreamTypeIds.COUNTER_STATE)
public enum CounterState {

   /**
    * The counter value is valid.
    */
   @ProtoEnumValue(number = 0)
   VALID,

   /**
    * The counter value has reached its min threshold, i.e. no thresholds has been reached.
    */
   @ProtoEnumValue(number = 1)
   LOWER_BOUND_REACHED,

   /**
    * The counter value has reached its max threshold.
    */
   @ProtoEnumValue(number = 2)
   UPPER_BOUND_REACHED;

   private static final CounterState[] CACHED_VALUES = CounterState.values();

   public static CounterState valueOf(int index) {
      return CACHED_VALUES[index];
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy