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

org.infinispan.api.async.AsyncWeakCounter Maven / Gradle / Ivy

The newest version!
package org.infinispan.api.async;

import java.util.concurrent.CompletionStage;

import org.infinispan.api.configuration.CounterConfiguration;

/**
 * @since 14.0
 **/
public interface AsyncWeakCounter {
   /**
    * @return The counter name.
    */
   String name();

   /**
    * Retrieves the counter's configuration.
    *
    * @return this counter's configuration.
    */
   CompletionStage configuration();

   /**
    * Return the container of this counter
    *
    * @return
    */
   AsyncContainer container();

   /**
    * Retrieves this counter's value.
    *
    * @return
    */
   CompletionStage value();

   /**
    * Increments the counter.
    */
   default CompletionStage increment() {
      return add(1L);
   }

   /**
    * Decrements the counter.
    */
   default CompletionStage decrement() {
      return add(-1L);
   }

   /**
    * Adds the given value to the new value.
    *
    * @param delta the value to add.
    */
   CompletionStage add(long delta);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy