
package de.ugoe.cs.quest.plugin.guitar.eventcore;

import de.ugoe.cs.quest.eventcore.IEventTarget;

/**
 * 
 * <p>
 * TODO comment
 * </p>
 * 
 * @version $Revision: $ $Date: Aug 16, 2012$
 * @author 2012, last modified by $Author: sherbold$
 */
public class GUITAREventTarget implements IEventTarget {

    private static final long serialVersionUID = 1L;

    String widgetId;

    public GUITAREventTarget(String widgetId) {
        this.widgetId = widgetId;
    }

    /*
     * (non-Javadoc)
     * 
     * @see de.ugoe.cs.quest.eventcore.IEventTarget#getPlatform()
     */
    @Override
    public String getPlatform() {
        return "GUITAR";
    }

    @Override
    public String getStringIdentifier() {
        return this.toString();
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return widgetId;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof GUITAREventTarget) {
            if (widgetId != null) {
                return widgetId.equals(((GUITAREventTarget) obj).widgetId);
            }
            else {
                return ((GUITAREventTarget) obj).widgetId == null;
            }
        }
        return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        int hash = 13;
        if (widgetId != null) {
            hash = widgetId.hashCode();
        }
        return hash;
    }

}
