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

package it.unimi.dsi.fastutil.shorts;

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

public class ShortByteImmutablePair implements ShortBytePair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final short left;
    protected final byte right;
    
    public ShortByteImmutablePair(final short left, final byte right) {
        this.left = left;
        this.right = right;
    }
    
    public static ShortByteImmutablePair of(final short left, final byte right) {
        return new ShortByteImmutablePair(left, right);
    }
    
    @Override
    public short leftShort() {
        return this.left;
    }
    
    @Override
    public byte rightByte() {
        return this.right;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof ShortBytePair) {
            return this.left == ((ShortBytePair)other).leftShort() && this.right == ((ShortBytePair)other).rightByte();
        }
        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;
    }
    
    @Override
    public String toString() {
        return "<" + this.leftShort() + "," + this.rightByte() + ">";
    }
}
