org.squirrelframework.foundation.util.Pair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of squirrel-foundation Show documentation
Show all versions of squirrel-foundation Show documentation
foundation module of squirrel framework which provided event driven infrastructure and a finite state machine implementation.
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