1 20 package org.apache.cactus.internal; 21 22 27 public final class ServiceEnumeration 28 { 29 32 public static final ServiceEnumeration CALL_TEST_SERVICE = 33 new ServiceEnumeration("CALL_TEST"); 34 35 38 public static final ServiceEnumeration GET_RESULTS_SERVICE = 39 new ServiceEnumeration("GET_RESULTS"); 40 41 44 public static final ServiceEnumeration RUN_TEST_SERVICE = 45 new ServiceEnumeration("RUN_TEST"); 46 47 52 public static final ServiceEnumeration CREATE_SESSION_SERVICE = 53 new ServiceEnumeration("CREATE_SESSION"); 54 55 61 public static final ServiceEnumeration GET_VERSION_SERVICE = 62 new ServiceEnumeration("GET_VERSION"); 63 64 67 private String name; 68 69 75 private ServiceEnumeration(String theServiceName) 76 { 77 this.name = theServiceName; 78 } 79 80 89 public boolean equals(String theString) 90 { 91 return theString.equals(this.name); 92 } 93 94 100 public boolean equals(Object theObject) 101 { 102 return super.equals(theObject); 103 } 104 105 111 public int hashCode() 112 { 113 return super.hashCode(); 114 } 115 116 122 public String toString() 123 { 124 return this.name; 125 } 126 127 135 public static ServiceEnumeration valueOf(String theName) 136 { 137 if (CALL_TEST_SERVICE.name.equals(theName)) 138 { 139 return CALL_TEST_SERVICE; 140 } 141 else if (GET_RESULTS_SERVICE.name.equals(theName)) 142 { 143 return GET_RESULTS_SERVICE; 144 } 145 else if (RUN_TEST_SERVICE.name.equals(theName)) 146 { 147 return RUN_TEST_SERVICE; 148 } 149 else if (CREATE_SESSION_SERVICE.name.equals(theName)) 150 { 151 return CREATE_SESSION_SERVICE; 152 } 153 else if (GET_VERSION_SERVICE.name.equals(theName)) 154 { 155 return GET_VERSION_SERVICE; 156 } 157 return null; 158 } 159 160 } 161 | Popular Tags |