// 
// 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 BooleanReferenceMutablePair<V> implements BooleanReferencePair<V>, Serializable
{
    private static final long serialVersionUID = 0L;
    protected boolean left;
    protected V right;
    
    public BooleanReferenceMutablePair(final boolean left, final V right) {
        this.left = left;
        this.right = right;
    }
    
    public static <V> BooleanReferenceMutablePair<V> of(final boolean left, final V right) {
        return new BooleanReferenceMutablePair<V>(left, right);
    }
    
    @Override
    public boolean leftBoolean() {
        return this.left;
    }
    
    @Override
    public BooleanReferenceMutablePair<V> left(final boolean l) {
        this.left = l;
        return this;
    }
    
    @Override
    public V right() {
        return this.right;
    }
    
    @Override
    public BooleanReferenceMutablePair<V> right(final V r) {
        this.right = r;
        return this;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof BooleanReferencePair) {
            return this.left == ((BooleanReferencePair)other).leftBoolean() && this.right == ((BooleanReferencePair)other).right();
        }
        return other instanceof Pair && Objects.equals(this.left, ((Pair)other).left()) && this.right == ((Pair)other).right();
    }
    
    @Override
    public int hashCode() {
        return (this.left ? 1231 : 1237) * 19 + ((this.right == null) ? 0 : System.identityHashCode(this.right));
    }
    
    @Override
    public String toString() {
        return "<" + this.leftBoolean() + "," + this.right() + ">";
    }
}
