All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reploop.parser.json.tree.Json Maven / Gradle / Ivy

package org.reploop.parser.json.tree;

import com.google.common.base.MoreObjects;
import org.reploop.parser.json.AstVisitor;
import org.reploop.parser.json.Node;

import java.util.Objects;

/**
 * A json.
 *
 * @author George Cao([email protected])
 * @since 2016-10-14 20
 */
public class Json extends Node {
    private final Value value;

    public Json(Value value) {
        this.value = value;
    }

    public Value getValue() {
        return value;
    }

    @Override
    public  R accept(AstVisitor visitor, C context) {
        return visitor.visitJson(this, context);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Json json = (Json) o;
        return Objects.equals(value, json.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value);
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
            .add("value", value)
            .toString();
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy