1 16 package org.apache.axis.client.async; 17 18 import org.apache.axis.constants.Enum; 19 20 25 public class Status extends Enum { 26 27 30 private static final Type type = new Type(); 31 32 35 public static final String NONE_STR = "none"; 36 37 40 public static final String INTERRUPTED_STR = "interrupted"; 41 42 45 public static final String COMPLETED_STR = "completed"; 46 47 50 public static final String EXCEPTION_STR = "exception"; 51 52 55 public static final Status NONE = type.getStatus(NONE_STR); 56 57 60 public static final Status INTERRUPTED = type.getStatus(INTERRUPTED_STR); 61 62 65 public static final Status COMPLETED = type.getStatus(COMPLETED_STR); 66 67 70 public static final Status EXCEPTION = type.getStatus(EXCEPTION_STR); 71 72 75 public static final Status DEFAULT = NONE; 76 77 static { 78 type.setDefault(DEFAULT); 79 } 80 81 86 public static Status getDefault() { 87 return (Status) type.getDefault(); 88 } 89 90 96 public static final Status getStatus(int style) { 97 return type.getStatus(style); 98 } 99 100 106 public static final Status getStatus(String style) { 107 return type.getStatus(style); 108 } 109 110 117 public static final Status getStatus(String style, Status dephault) { 118 return type.getStatus(style, dephault); 119 } 120 121 127 public static final boolean isValid(String style) { 128 return type.isValid(style); 129 } 130 131 136 public static final int size() { 137 return type.size(); 138 } 139 140 145 public static final String [] getUses() { 146 return type.getEnumNames(); 147 } 148 149 155 public static class Type extends Enum.Type { 156 157 160 private Type() { 161 162 super("status", new Enum []{new Status(0, NONE_STR), 163 new Status(1, INTERRUPTED_STR), 164 new Status(2, COMPLETED_STR), 165 new Status(3, EXCEPTION_STR), }); 166 } 167 168 174 public final Status getStatus(int status) { 175 return (Status) this.getEnum(status); 176 } 177 178 184 public final Status getStatus(String status) { 185 return (Status) this.getEnum(status); 186 } 187 188 195 public final Status getStatus(String status, Status dephault) { 196 return (Status) this.getEnum(status, dephault); 197 } 198 } 199 200 206 private Status(int value, String name) { 207 super(type, value, name); 208 } 209 } 210 | Popular Tags |