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

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

package org.reploop.parser.json.tree;

import org.reploop.parser.json.AstVisitor;

import java.util.Objects;

/**
 * String value.
 *
 * @author George Cao([email protected])
 * @since 2017-01-23 18
 */
public class Text extends Value {
    private final String val;

    public Text(String val) {
        this.val = val;
    }

    public String getVal() {
        return val;
    }

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

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

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

    @Override
    public String toString() {
        return val;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy