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

package org.bson;

public class BsonElement
{
    private final String name;
    private final BsonValue value;
    
    public BsonElement(final String name, final BsonValue value) {
        this.name = name;
        this.value = value;
    }
    
    public String getName() {
        return this.name;
    }
    
    public BsonValue getValue() {
        return this.value;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }
        final BsonElement that = (BsonElement)o;
        Label_0062: {
            if (this.getName() != null) {
                if (this.getName().equals(that.getName())) {
                    break Label_0062;
                }
            }
            else if (that.getName() == null) {
                break Label_0062;
            }
            return false;
        }
        if (this.getValue() != null) {
            if (this.getValue().equals(that.getValue())) {
                return true;
            }
        }
        else if (that.getValue() == null) {
            return true;
        }
        return false;
    }
    
    @Override
    public int hashCode() {
        int result = (this.getName() != null) ? this.getName().hashCode() : 0;
        result = 31 * result + ((this.getValue() != null) ? this.getValue().hashCode() : 0);
        return result;
    }
}
