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

package it.unimi.dsi.fastutil.objects;

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

public class ReferenceCharMutablePair<K> implements ReferenceCharPair<K>, Serializable
{
    private static final long serialVersionUID = 0L;
    protected K left;
    protected char right;
    
    public ReferenceCharMutablePair(final K left, final char right) {
        this.left = left;
        this.right = right;
    }
    
    public static <K> ReferenceCharMutablePair<K> of(final K left, final char right) {
        return new ReferenceCharMutablePair<K>(left, right);
    }
    
    @Override
    public K left() {
        return this.left;
    }
    
    @Override
    public ReferenceCharMutablePair<K> left(final K l) {
        this.left = l;
        return this;
    }
    
    @Override
    public char rightChar() {
        return this.right;
    }
    
    @Override
    public ReferenceCharMutablePair<K> right(final char r) {
        this.right = r;
        return this;
    }
    
    @Override
    public boolean equals(final Object other) {
        if (other == null) {
            return false;
        }
        if (other instanceof ReferenceCharPair) {
            return this.left == ((ReferenceCharPair)other).left() && this.right == ((ReferenceCharPair)other).rightChar();
        }
        return other instanceof Pair && this.left == ((Pair)other).left() && Objects.equals(this.right, ((Pair)other).right());
    }
    
    @Override
    public int hashCode() {
        return System.identityHashCode(this.left) * 19 + this.right;
    }
    
    @Override
    public String toString() {
        return "<" + this.left() + "," + this.rightChar() + ">";
    }
}
