01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.util;
04:
05: public class State {
06: private final String name;
07:
08: public State(String name) {
09: Assert.assertNotNull(name);
10: this .name = name;
11: }
12:
13: public String getName() {
14: return name;
15: }
16:
17: public boolean equals(Object o) {
18: if (!(o instanceof State)) {
19: return false;
20: }
21: return name.equals(((State) o).name);
22: }
23:
24: public int hashCode() {
25: return name.hashCode();
26: }
27:
28: public String toString() {
29: return "State[ " + this .name + " ]";
30: }
31: }
|