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

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

package org.reploop.parser.json.tree;

import org.reploop.parser.json.AstVisitor;

import java.util.List;
import java.util.Objects;

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

    public Array(List values) {
        this.values = values;
    }

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

    public List getValues() {
        return values;
    }

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

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

    @Override
    public String toString() {
        return values.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy