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

package it.unimi.dsi.fastutil.bytes;

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

public class ByteBooleanMutablePair implements ByteBooleanPair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected byte left;
    protected boolean right;
    
    public ByteBooleanMutablePair(final byte left, final boolean right) {
        this.left = left;
        this.right = right;
    }
    
    public static ByteBooleanMutablePair of(final byte left, final boolean right) {
        return new ByteBooleanMutablePair(left, right);
    }
    
    @Override
    public byte leftByte() {
        return this.left;
    }
    
    @Override
    public ByteBooleanMutablePair left(final byte l) {
        this.left = l;
        return this;
    }
    
    @Override
    public boolean rightBoolean() {
        return this.right;
    }
    
    @Override
    public ByteBooleanMutablePair right(final boolean r) {
        this.right = r;
        return this;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof ByteBooleanPair) {
            return this.left == ((ByteBooleanPair)other).leftByte() && this.right == ((ByteBooleanPair)other).rightBoolean();
        }
        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 * 19 + (this.right ? 1231 : 1237);
    }
    
    @Override
    public String toString() {
        return "<" + this.leftByte() + "," + this.rightBoolean() + ">";
    }
}
