01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.object.config.schema;
06:
07: import com.tc.util.Assert;
08:
09: /**
10: * Represents the level of a lock.
11: */
12: public class LockLevel {
13:
14: private final String level;
15:
16: private LockLevel(String 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(
25: "concurrent");
26: public static final LockLevel SYNCHRONOUS_WRITE = new LockLevel(
27: "synchronous-write");
28:
29: public boolean equals(Object that) {
30: if (!(that instanceof LockLevel))
31: return false;
32: return ((LockLevel) that).level.equals(this .level);
33: }
34:
35: public int hashCode() {
36: return this .level.hashCode();
37: }
38:
39: public String toString() {
40: return level;
41: }
42:
43: }
|