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

package it.unimi.dsi.fastutil.chars;

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

public class CharByteImmutablePair implements CharBytePair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final char left;
    protected final byte right;
    
    public CharByteImmutablePair(final char left, final byte right) {
        this.left = left;
        this.right = right;
    }
    
    public static CharByteImmutablePair of(final char left, final byte right) {
        return new CharByteImmutablePair(left, right);
    }
    
    @Override
    public char leftChar() {
        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 CharBytePair) {
            return this.left == ((CharBytePair)other).leftChar() && this.right == ((CharBytePair)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 * '\u0013' + this.right;
    }
    
    @Override
    public String toString() {
        return "<" + this.leftChar() + "," + this.rightByte() + ">";
    }
}
