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

com.heliorm.impl.ExpressionPart Maven / Gradle / Ivy

The newest version!
package com.heliorm.impl;

import com.heliorm.Field;
import com.heliorm.def.Continuation;

import java.util.LinkedList;
import java.util.List;

/**
 * @param  Type of POJO
 * @param  Type of the field
 * @author gideon
 */
public abstract class ExpressionPart implements Continuation {

    public enum Type {
        VALUE_EXPRESSION,
        LIST_EXPRESSION, IS_EXPRESSION
    }

    private final Type type;
    private final Field field;
    private final List> continuations = new LinkedList<>();
    public ExpressionPart(Type type, Field field) {
        this.type = type;
        this.field = field;
    }

    @Override
    public Continuation and(Continuation expr) {
         continuations.add(new ExpressionContinuationPart<>(ExpressionContinuationPart.Type.AND, expr));
         return this;
    }

    @Override
    public Continuation or(Continuation expr) {
        continuations.add( new ExpressionContinuationPart<>(ExpressionContinuationPart.Type.OR, expr));
        return this;
    }

    public final Type getType() {
        return type;
    }

    public final Field getField() {
        return field;
    }

    public List> getContinuations() {
        return continuations;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy