1 package org.linphone.core;
3 import java.util.Vector;
6 static private Vector<Reason> values = new Vector<Reason>();
10 static public Reason None = new Reason(0,"None");
14 static public Reason NoResponse = new Reason(1,"NoResponse");
18 static public Reason BadCredentials = new Reason(2,"BadCredentials");
22 static public Reason Declined = new Reason(3,"Declined");
26 static public Reason NotFound = new Reason(4,"NotFound");
28 * Call not answered (in time).
30 static public Reason NotAnswered = new Reason(5,"NotAnswered");
32 * Call not answered (in time).
34 static public Reason Busy = new Reason(6,"Busy");
36 protected final int mValue;
37 private final String mStringValue;
40 private Reason(int value,String stringValue) {
42 values.addElement(this);
43 mStringValue=stringValue;
45 public static Reason fromInt(int value) {
46 for (int i=0; i<values.size();i++) {
47 Reason state = (Reason) values.elementAt(i);
48 if (state.mValue == value) return state;
50 throw new RuntimeException("Reason not found ["+value+"]");
53 public String toString() {