View Javadoc

1   package com.atlassian.vcache;
2   
3   import javax.annotation.Nonnull;
4   
5   import com.atlassian.annotations.PublicApi;
6   
7   /**
8    * Represents a value that has an associated {@link CasIdentifier} that can be used for "compare-and-swap" operations.
9    *
10   * @param <T> the type of the value
11   * @since 1.0
12   */
13  @PublicApi
14  public interface IdentifiedValue<T>
15  {
16      /**
17       * Returns the value.
18       * @return the value.
19       */
20      @Nonnull
21      T value();
22  
23      /**
24       * Returns the {@link CasIdentifier} associated with the value.
25       * @return the {@link CasIdentifier} associated with the value.
26       */
27      @Nonnull
28      CasIdentifier identifier();
29  }