View Javadoc

1   package com.atlassian.vcache.internal.memcached;
2   
3   import com.atlassian.vcache.CasIdentifier;
4   
5   import javax.annotation.Nullable;
6   
7   /**
8    * Implementation for Memcached.
9    *
10   * @since 1.0.0
11   */
12  class MemcachedCasIdentifier implements CasIdentifier {
13      private long id;
14  
15      MemcachedCasIdentifier(long id) {
16          this.id = id;
17      }
18  
19      long getId() {
20          return id;
21      }
22  
23      @Override
24      public boolean equals(@Nullable Object o) {
25          if (this == o) {
26              return true;
27          }
28  
29          //noinspection SimplifiableIfStatement
30          if (o == null || getClass() != o.getClass()) {
31              return false;
32          }
33  
34          return id == ((MemcachedCasIdentifier) o).id;
35      }
36  }