KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > config > schema > LockLevel


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.object.config.schema;
6
7 import com.tc.util.Assert;
8
9 /**
10  * Represents the level of a lock.
11  */

12 public class LockLevel {
13
14   private final String JavaDoc level;
15
16   private LockLevel(String JavaDoc level) {
17     Assert.assertNotBlank(level);
18
19     this.level = level;
20   }
21
22   public static final LockLevel WRITE = new LockLevel("write");
23   public static final LockLevel READ = new LockLevel("read");
24   public static final LockLevel CONCURRENT = new LockLevel("concurrent");
25   public static final LockLevel SYNCHRONOUS_WRITE = new LockLevel("synchronous-write");
26
27   public boolean equals(Object JavaDoc that) {
28     if (!(that instanceof LockLevel)) return false;
29     return ((LockLevel) that).level.equals(this.level);
30   }
31
32   public int hashCode() {
33     return this.level.hashCode();
34   }
35
36   public String JavaDoc toString() {
37     return level;
38   }
39
40 }
41
Popular Tags