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

eu.xenit.apix.search.nodes.OperatorSearchNode Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
package eu.xenit.apix.search.nodes;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import eu.xenit.apix.search.json.IJsonTyped;
import eu.xenit.apix.search.json.OperatorSearchNodeDeserializer;
import eu.xenit.apix.search.visitors.ISearchSyntaxVisitor;
import java.util.List;

/**
 * Represents an AND or OR search node.
 */
@JsonDeserialize(using = OperatorSearchNodeDeserializer.class)
public class OperatorSearchNode implements SearchSyntaxNode, IJsonTyped {

    private Operator operator;
    private List children;

    public OperatorSearchNode(Operator operator, List children) {
        this.operator = operator;
        this.children = children;
    }

    public Operator getOperator() {
        return operator;
    }

    public void setOperator(Operator operator) {
        this.operator = operator;
    }

    public List getChildren() {
        return children;
    }

    public void setChildren(List children) {
        this.children = children;
    }

    @Override
    public  T accept(ISearchSyntaxVisitor visitor) {
        return visitor.visit(this);
    }

    @Override
    public void setTypeId(String id) {
        operator = OperatorSearchNode.Operator.valueOf(id.toUpperCase());
    }

    public enum Operator {
        AND, OR
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy