// 
// Decompiled by Procyon v0.6.0
// 

package it.unimi.dsi.fastutil.booleans;

import java.util.Objects;
import it.unimi.dsi.fastutil.Pair;
import java.io.Serializable;

public class BooleanIntImmutablePair implements BooleanIntPair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final boolean left;
    protected final int right;
    
    public BooleanIntImmutablePair(final boolean left, final int right) {
        this.left = left;
        this.right = right;
    }
    
    public static BooleanIntImmutablePair of(final boolean left, final int right) {
        return new BooleanIntImmutablePair(left, right);
    }
    
    @Override
    public boolean leftBoolean() {
        return this.left;
    }
    
    @Override
    public int rightInt() {
        return this.right;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof BooleanIntPair) {
            return this.left == ((BooleanIntPair)other).leftBoolean() && this.right == ((BooleanIntPair)other).rightInt();
        }
        return other instanceof Pair && Objects.equals(this.left, ((Pair)other).left()) && Objects.equals(this.right, ((Pair)other).right());
    }
    
    @Override
    public int hashCode() {
        return (this.left ? 1231 : 1237) * 19 + this.right;
    }
    
    @Override
    public String toString() {
        return "<" + this.leftBoolean() + "," + this.rightInt() + ">";
    }
}
