KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > util > State


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

4 package com.tc.util;
5
6
7 public class State {
8   private final String JavaDoc name;
9
10   public State(String JavaDoc name) {
11     Assert.assertNotNull(name);
12     this.name = name;
13   }
14   
15   public String JavaDoc getName() {
16     return name;
17   }
18   
19   public boolean equals(Object JavaDoc o) {
20     if(!(o instanceof State)) { return false; }
21     return name.equals(((State)o).name);
22   }
23   
24   public int hashCode() {
25     return name.hashCode();
26   }
27
28   public String JavaDoc toString() {
29     return "State[ " + this.name + " ]";
30   }
31 }
Popular Tags