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

package it.unimi.dsi.fastutil.booleans;

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

public class BooleanFloatImmutablePair implements BooleanFloatPair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final boolean left;
    protected final float right;
    
    public BooleanFloatImmutablePair(final boolean left, final float right) {
        this.left = left;
        this.right = right;
    }
    
    public static BooleanFloatImmutablePair of(final boolean left, final float right) {
        return new BooleanFloatImmutablePair(left, right);
    }
    
    @Override
    public boolean leftBoolean() {
        return this.left;
    }
    
    @Override
    public float rightFloat() {
        return this.right;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof BooleanFloatPair) {
            return this.left == ((BooleanFloatPair)other).leftBoolean() && this.right == ((BooleanFloatPair)other).rightFloat();
        }
        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 + HashCommon.float2int(this.right);
    }
    
    @Override
    public String toString() {
        return "<" + this.leftBoolean() + "," + this.rightFloat() + ">";
    }
}
