View Javadoc

1   /*
2    *  Copyright 2004-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.util.Date;
20  
21  /**
22   * An entry in the dialed channels history of an {@link AsteriskChannel}.
23   *
24   * @author srt
25   * @version $Id$
26   * @since 0.3
27   */
28  public class DialedChannelHistoryEntry
29  {
30      private final Date date;
31      private final AsteriskChannel channel;
32  
33      /**
34       * Creates a new instance.
35       *
36       * @param date    the date the channel was dialed.
37       * @param channel the channel that has been dialed.
38       */
39      public DialedChannelHistoryEntry(Date date, AsteriskChannel channel)
40      {
41          this.date = date;
42          this.channel = channel;
43      }
44  
45      /**
46       * Returns the date the channel was dialed.
47       *
48       * @return the date the channel was dialed.
49       */
50      public Date getDate()
51      {
52          return date;
53      }
54  
55      /**
56       * Returns the channel that has been dialed.
57       *
58       * @return the channel that has been dialed.
59       */
60      public AsteriskChannel getChannel()
61      {
62          return channel;
63      }
64  
65      @Override
66      public String toString()
67      {
68          final StringBuilder sb;
69  
70          sb = new StringBuilder("DialedChannelHistoryEntry[");
71          sb.append("date=").append(date).append(",");
72          sb.append("channel=").append(channel).append("]");
73          return sb.toString();
74      }
75  }