View Javadoc

1   /*
2    *  Copyright 2005-2006 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package org.asteriskjava.live;
18  
19  import java.io.Serializable;
20  
21  public class Extension implements Serializable
22  {
23      /***
24       * Serial version identifier.
25       */
26      private static final long serialVersionUID = 768239042942945744L;
27      private final String context;
28      private final String extension;
29      private final Integer priority;
30      private final String application;
31      private final String appData;
32  
33      /***
34       * @param context
35       * @param extension
36       * @param priority
37       */
38      public Extension(String context, String extension, Integer priority)
39      {
40          this(context, extension, priority, null, null);
41      }
42  
43      /***
44       * @param context
45       * @param extension
46       * @param priority
47       * @param application
48       * @param appData
49       */
50      public Extension(String context, String extension,
51                       Integer priority, String application, String appData)
52      {
53          this.context = context;
54          this.extension = extension;
55          this.priority = priority;
56          this.application = application;
57          this.appData = appData;
58      }
59  
60      public String getContext()
61      {
62          return context;
63      }
64  
65      public String getExtension()
66      {
67          return extension;
68      }
69  
70      public Integer getPriority()
71      {
72          return priority;
73      }
74  
75      public String getApplication()
76      {
77          return application;
78      }
79  
80      public String getAppData()
81      {
82          return appData;
83      }
84  
85      @Override
86      public String toString()
87      {
88          StringBuffer sb;
89  
90          sb = new StringBuffer("Extension[");
91          sb.append("context='").append(getContext()).append("',");
92          sb.append("extension='").append(getExtension()).append("',");
93          sb.append("priority='").append(getPriority()).append("',");
94          sb.append("application='").append(getApplication()).append("',");
95          sb.append("appData=").append(getAppData()).append("]");
96  
97          return sb.toString();
98      }
99  }