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

org.squirrelframework.foundation.util.Pair Maven / Gradle / Ivy

Go to download

foundation module of squirrel framework which provided event driven infrastructure and a finite state machine implementation.

There is a newer version: 0.3.10
Show newest version
package org.squirrelframework.foundation.util;

public class Pair {
    private final F first;
    private final S second;

    public Pair(F a, S b) {
        this.first = a;
        this.second = b;
    }

    public F first() {
        return first;
    }

    public S second() {
        return second;
    }
    
    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Pair)) {
            return false;
        }
        Pair other = (Pair) o;
        return first.equals(other.first) && second.equals(other.second);
    }
    
    @Override
    public int hashCode() {
        return first.hashCode() * 13 + second.hashCode() * 7;
    }
    
    @Override
    public String toString() {
        return first + ":" + second;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy