// 
// 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 CharCharImmutablePair implements CharCharPair, Serializable
{
    private static final long serialVersionUID = 0L;
    protected final char left;
    protected final char right;
    
    public CharCharImmutablePair(final char left, final char right) {
        this.left = left;
        this.right = right;
    }
    
    public static CharCharImmutablePair of(final char left, final char right) {
        return new CharCharImmutablePair(left, right);
    }
    
    @Override
    public char leftChar() {
        return this.left;
    }
    
    @Override
    public char rightChar() {
        return this.right;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof CharCharPair) {
            return this.left == ((CharCharPair)other).leftChar() && this.right == ((CharCharPair)other).rightChar();
        }
        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.rightChar() + ">";
    }
}
