1 package javax.sip;
2 
3 public enum DialogState {
4     EARLY,
5     CONFIRMED,
6     TERMINATED;
7 
8     public static final int _EARLY = EARLY.ordinal();
9     public static final int _CONFIRMED = CONFIRMED.ordinal();
10     public static final int _TERMINATED = TERMINATED.ordinal();
11 
getObject(int state)12     public static DialogState getObject(int state) {
13         try {
14             return values()[state];
15         } catch (IndexOutOfBoundsException e) {
16             throw new IllegalArgumentException(
17                     "Invalid dialog state: " + state);
18         }
19     }
20 
getValue()21     public int getValue() {
22         return ordinal();
23     }
24 }
25