+
+ static public class UpnpState {
+ static private Vector<UpnpState> values = new Vector<UpnpState>();
+ /**
+ * Idle
+ */
+ static public UpnpState Idle = new UpnpState(0, "Idle");
+ /**
+ * Pending
+ */
+ static public UpnpState Pending = new UpnpState(1, "Pending");
+ /**
+ * Adding
+ */
+ static public UpnpState Adding = new UpnpState(2, "Adding");
+ /**
+ * Removing
+ */
+ static public UpnpState Removing = new UpnpState(3, "Removing");
+ /**
+ * Not Available
+ */
+ static public UpnpState NotAvailable = new UpnpState(4, "Not available");
+ /**
+ * Ok
+ */
+ static public UpnpState Ok = new UpnpState(5, "Ok");
+ /**
+ * Ko
+ */
+ static public UpnpState Ko = new UpnpState(6, "Ko");
+ protected final int mValue;
+ private final String mStringValue;
+
+ private UpnpState(int value, String stringValue) {
+ mValue = value;
+ values.addElement(this);
+ mStringValue = stringValue;
+ }
+ public static UpnpState fromInt(int value) {
+ for (int i = 0; i < values.size(); i++) {
+ UpnpState mstate = (UpnpState) values.elementAt(i);
+ if (mstate.mValue == value) return mstate;
+ }
+ throw new RuntimeException("UpnpState not found [" + value + "]");
+ }
+ public String toString() {
+ return mStringValue;
+ }
+ }