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

org.directwebremoting.util.Pair Maven / Gradle / Ivy

Go to download

DWR is easy Ajax for Java. It makes it simple to call Java code directly from Javascript. It gets rid of almost all the boilerplate code between the web browser and your Java code. This version 4.0.2 works with Jakarta Servlet 4.0.2.

The newest version!
package org.directwebremoting.util;

/**
 * Man this is embarrassing.
 * @author Joe Walker [joe at getahead dot ltd dot uk]
 */
@SuppressWarnings({"ClassEscapesDefinedScope"})
public class Pair
{
    public final A left;

    public final B right;

    public Pair(A left, B right)
    {
        this.left = left;
        this.right = right;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj)
    {

        if (obj == null || (!this.getClass().equals(obj.getClass())))
        {
            return false;
        }

        if (obj == this)
        {
            return true;
        }

        @SuppressWarnings("unchecked")
        Pair that = (Pair) obj;

        if (!LocalUtil.equals(this.left, that.left))
        {
            return false;
        }

        if (!LocalUtil.equals(this.right, that.right))
        {
            return false;
        }

        return true;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode()
    {
        int hash = 24;
        hash += (left != null) ? left.hashCode() : 432;
        hash += (right != null) ? right.hashCode() : 635;
        return hash;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return "[" + left + ":" + right + "]";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy