All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jasig.irclog.events.PrivateMessageEvent Maven / Gradle / Ivy

/* Copyright 2006 The JA-SIG Collaborative.  All rights reserved.
*  See license distributed with this file and
*  available online at http://www.uportal.org/license.html
*/

package org.jasig.irclog.events;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.jibble.pircbot.PircBot;

/**
 * @see PircBot#onPrivateMessage(String, String, String, String)
 * 
 * @author Eric Dalquist [email protected]
 * @version $Revision$
 */
public class PrivateMessageEvent extends IrcEvent {
    private static final List PROPERTIES = Collections.unmodifiableList(Arrays.asList(new String[] { "sender", "login", "hostname", "message" }));
    
    protected final String sender;
    protected final String login;
    protected final String hostname;
    protected final String message;
    
    public PrivateMessageEvent(final PircBot source, final String sender, final String login, final String hostname, final String message) {
        super(source);
        this.sender = sender;
        this.login = login;
        this.hostname = hostname;
        this.message = message;
    }

    /**
     * @see org.jasig.irclog.events.IrcEvent#getArgumentProperties()
     */
    @Override
    protected List getArgumentProperties() {
        final List parentProps = super.getArgumentProperties();
        final List props = new ArrayList(PROPERTIES.size() + parentProps.size());
        
        props.addAll(parentProps);
        props.addAll(PROPERTIES);
        
        return props;
    }

    /**
     * @return the hostname
     */
    public String getHostname() {
        return this.hostname;
    }

    /**
     * @return the login
     */
    public String getLogin() {
        return this.login;
    }

    /**
     * @return the message
     */
    public String getMessage() {
        return this.message;
    }

    /**
     * @return the sender
     */
    public String getSender() {
        return this.sender;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy