1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.manager;
18
19 import java.io.Serializable;
20 import java.util.Date;
21
22 /***
23 * Represents an Asterisk dialplan entry.
24 *
25 * @author srt
26 * @version $Id: Extension.java,v 1.5 2005/08/08 06:10:18 srt Exp $
27 */
28 public class Extension implements Serializable
29 {
30 /***
31 * Serial version identifier.
32 */
33 private static final long serialVersionUID = 768239042942945744L;
34 private final Date date;
35 private final String context;
36 private final String extension;
37 private final Integer priority;
38 private final String application;
39 private final String appData;
40
41 /***
42 * @param date
43 * @param context
44 * @param extension
45 * @param priority
46 */
47 public Extension(Date date, String context, String extension,
48 Integer priority)
49 {
50 this(date, context, extension, priority, null, null);
51 }
52
53 /***
54 * @param date
55 * @param context
56 * @param extension
57 * @param priority
58 * @param application
59 * @param appData
60 */
61 public Extension(Date date, String context, String extension,
62 Integer priority, String application, String appData)
63 {
64 this.date = date;
65 this.context = context;
66 this.extension = extension;
67 this.priority = priority;
68 this.application = application;
69 this.appData = appData;
70 }
71
72 public Date getDate()
73 {
74 return date;
75 }
76
77 public String getContext()
78 {
79 return context;
80 }
81
82 public String getExtension()
83 {
84 return extension;
85 }
86
87 public Integer getPriority()
88 {
89 return priority;
90 }
91
92 public String getApplication()
93 {
94 return application;
95 }
96
97 public String getAppData()
98 {
99 return appData;
100 }
101
102 public String toString()
103 {
104 StringBuffer sb;
105
106 sb = new StringBuffer(getClass().getName() + ": ");
107 sb.append("date='" + getDate() + "'; ");
108 sb.append("context='" + getContext() + "'; ");
109 sb.append("extension='" + getExtension() + "'; ");
110 sb.append("priority='" + getPriority() + "'; ");
111 sb.append("application='" + getApplication() + "'; ");
112 sb.append("appData=" + getAppData() + "; ");
113 sb.append("systemHashcode=" + System.identityHashCode(this));
114
115 return sb.toString();
116 }
117 }