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 ControllerMode extends JBossObject 34 { 35 36 public static final ControllerMode AUTOMATIC = new ControllerMode("Automatic"); 37 38 39 public static final ControllerMode ON_DEMAND = new ControllerMode("On Demand"); 40 41 42 public static final ControllerMode MANUAL = new ControllerMode("Manual"); 43 44 45 public static final ControllerMode DISABLED = new ControllerMode("Disabled"); 46 47 48 protected final String modeString; 49 50 55 public ControllerMode(String modeString) 56 { 57 if (modeString == null) 58 throw new IllegalArgumentException ("Null mode string"); 59 this.modeString = modeString; 60 } 61 62 67 public String getModeString() 68 { 69 return modeString; 70 } 71 72 public boolean equals(Object object) 73 { 74 if (object == null || object instanceof ControllerMode == false) 75 return false; 76 ControllerMode other = (ControllerMode) object; 77 return modeString.equals(other.modeString); 78 } 79 80 public void toString(JBossStringBuilder buffer) 81 { 82 buffer.append(modeString); 83 } 84 85 protected int getHashCode() 86 { 87 return modeString.hashCode(); 88 } 89 } 90 | Popular Tags |