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

package it.unimi.dsi.fastutil.bytes;

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

public class ByteLongMutablePair implements ByteLongPair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected byte left;
    protected long right;
    
    public ByteLongMutablePair(final byte left, final long right) {
        this.left = left;
        this.right = right;
    }
    
    public static ByteLongMutablePair of(final byte left, final long right) {
        return new ByteLongMutablePair(left, right);
    }
    
    @Override
    public byte leftByte() {
        return this.left;
    }
    
    @Override
    public ByteLongMutablePair left(final byte l) {
        this.left = l;
        return this;
    }
    
    @Override
    public long rightLong() {
        return this.right;
    }
    
    @Override
    public ByteLongMutablePair right(final long r) {
        this.right = r;
        return this;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof ByteLongPair) {
            return this.left == ((ByteLongPair)other).leftByte() && this.right == ((ByteLongPair)other).rightLong();
        }
        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 + HashCommon.long2int(this.right);
    }
    
    @Override
    public String toString() {
        return "<" + this.leftByte() + "," + this.rightLong() + ">";
    }
}
