1 22 package org.jboss.dependency.spi; 23 24 import org.jboss.util.JBossObject; 25 import org.jboss.util.JBossStringBuilder; 26 27 33 public class ControllerState extends JBossObject 34 { 35 36 public static final ControllerState ERROR = new ControllerState("**ERROR**"); 37 38 39 public static final ControllerState NOT_INSTALLED = new ControllerState("Not Installed"); 40 41 42 public static final ControllerState DESCRIBED = new ControllerState("Described"); 43 44 45 public static final ControllerState INSTANTIATED = new ControllerState("Instantiated"); 46 47 48 public static final ControllerState CONFIGURED = new ControllerState("Configured"); 49 50 51 public static final ControllerState CREATE = new ControllerState("Create"); 52 53 54 public static final ControllerState START = new ControllerState("Start"); 55 56 57 public static final ControllerState INSTALLED = new ControllerState("Installed"); 58 59 60 protected final String stateString; 61 62 67 public ControllerState(String stateString) 68 { 69 if (stateString == null) 70 throw new IllegalArgumentException ("Null state string"); 71 this.stateString = stateString; 72 } 73 74 79 public String getStateString() 80 { 81 return stateString; 82 } 83 84 public boolean equals(Object object) 85 { 86 if (object == null || object instanceof ControllerState == false) 87 return false; 88 ControllerState other = (ControllerState) object; 89 return stateString.equals(other.stateString); 90 } 91 92 public void toString(JBossStringBuilder buffer) 93 { 94 buffer.append(stateString); 95 } 96 97 protected int getHashCode() 98 { 99 return stateString.hashCode(); 100 } 101 } 102 | Popular Tags |