View Javadoc

1   /* Copyright 2006 The JA-SIG Collaborative.  All rights reserved.
2   *  See license distributed with this file and
3   *  available online at http://www.uportal.org/license.html
4   */
5   
6   package org.jasig.irclog.events;
7   
8   import java.util.ArrayList;
9   import java.util.Arrays;
10  import java.util.Collections;
11  import java.util.List;
12  
13  import org.jibble.pircbot.PircBot;
14  
15  /***
16   * @see PircBot#onJoin(String, String, String, String) 
17   * 
18   * @author Eric Dalquist <a href="mailto:eric.dalquist@doit.wisc.edu">eric.dalquist@doit.wisc.edu</a>
19   * @version $Revision$
20   */
21  public class JoinEvent extends ChannelEvent {
22      private static final List<String> PROPERTIES = Collections.unmodifiableList(Arrays.asList(new String[] { "sender", "login", "hostname" }));
23      
24      protected final String sender;
25      protected final String login;
26      protected final String hostname;
27      
28      
29      public JoinEvent(final PircBot source, final String channel, final String sender, final String login, final String hostname) {
30          super(source, channel);
31          this.sender = sender;
32          this.login = login;
33          this.hostname = hostname;
34      }
35  
36      /***
37       * @see org.jasig.irclog.events.IrcEvent#getArgumentProperties()
38       */
39      @Override
40      protected List<String> getArgumentProperties() {
41          final List<String> parentProps = super.getArgumentProperties();
42          final List<String> props = new ArrayList<String>(PROPERTIES.size() + parentProps.size());
43          
44          props.addAll(parentProps);
45          props.addAll(PROPERTIES);
46          
47          return props;
48      }
49  
50      /***
51       * @return the hostname
52       */
53      public String getHostname() {
54          return this.hostname;
55      }
56  
57      /***
58       * @return the login
59       */
60      public String getLogin() {
61          return this.login;
62      }
63  
64      /***
65       * @return the sender
66       */
67      public String getSender() {
68          return this.sender;
69      }
70  }