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

package it.unimi.dsi.fastutil.bytes;

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

public class ByteObjectMutablePair<V> implements ByteObjectPair<V>, Serializable
{
    private static final long serialVersionUID = 0L;
    protected byte left;
    protected V right;
    
    public ByteObjectMutablePair(final byte left, final V right) {
        this.left = left;
        this.right = right;
    }
    
    public static <V> ByteObjectMutablePair<V> of(final byte left, final V right) {
        return new ByteObjectMutablePair<V>(left, right);
    }
    
    @Override
    public byte leftByte() {
        return this.left;
    }
    
    @Override
    public ByteObjectMutablePair<V> left(final byte l) {
        this.left = l;
        return this;
    }
    
    @Override
    public V right() {
        return this.right;
    }
    
    @Override
    public ByteObjectMutablePair<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 ByteObjectPair) {
            return this.left == ((ByteObjectPair)other).leftByte() && Objects.equals(this.right, ((ByteObjectPair)other).right());
        }
        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 == null) ? 0 : this.right.hashCode());
    }
    
    @Override
    public String toString() {
        return "<" + this.leftByte() + "," + this.right() + ">";
    }
}
