Java Code Examples for io.siddhi.core.executor.ExpressionExecutor#toString()

The following examples show how to use io.siddhi.core.executor.ExpressionExecutor#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilterProcessor.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public FilterProcessor(ExpressionExecutor conditionExecutor) {
    if (Attribute.Type.BOOL.equals(conditionExecutor.getReturnType())) {
        this.conditionExecutor = conditionExecutor;
    } else {
        throw new OperationNotSupportedException("Return type of " + conditionExecutor.toString() + " should be " +
                "of type BOOL. " +
                "Actual type: " + conditionExecutor.getReturnType().toString());
    }
}
 
Example 2
Source File: AndConditionExpressionExecutor.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public AndConditionExpressionExecutor(ExpressionExecutor leftConditionExecutor,
                                      ExpressionExecutor rightConditionExecutor) {
    if (leftConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)
            && rightConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {

        this.leftConditionExecutor = leftConditionExecutor;
        this.rightConditionExecutor = rightConditionExecutor;
    } else {
        if (!leftConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {
            throw new OperationNotSupportedException("Return type of condition executor " +
                    leftConditionExecutor.toString() +
                    " should be of type BOOL. Actual Type: " +
                    leftConditionExecutor.getReturnType().toString());
        } else if (!rightConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {
            throw new OperationNotSupportedException("Return type of condition executor " +
                    rightConditionExecutor.toString() + " should be of "
                    + "type BOOL. Actual Type: " +
                    rightConditionExecutor.getReturnType().toString());
        } else {
            throw new OperationNotSupportedException("Return type of condition executor " +
                    leftConditionExecutor.toString() +
                    " and condition executor" +
                    rightConditionExecutor.toString() +
                    "should be of type BOOL. Left executor: " +
                    leftConditionExecutor.getReturnType().toString() +
                    " Right executor: " +
                    rightConditionExecutor.getReturnType().toString());
        }
    }

}
 
Example 3
Source File: NotConditionExpressionExecutor.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public NotConditionExpressionExecutor(ExpressionExecutor conditionExecutor) {
    if (conditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {
        this.conditionExecutor = conditionExecutor;
    } else {
        throw new OperationNotSupportedException("Return type of condition executor " + conditionExecutor
                .toString() + " should be of type BOOL. Actual Type: " + conditionExecutor.getReturnType()
                .toString());
    }
}
 
Example 4
Source File: OrConditionExpressionExecutor.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public OrConditionExpressionExecutor(ExpressionExecutor leftConditionExecutor,
                                     ExpressionExecutor rightConditionExecutor) {
    if (leftConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)
            && rightConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {

        this.leftConditionExecutor = leftConditionExecutor;
        this.rightConditionExecutor = rightConditionExecutor;
    } else {
        if (!leftConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {
            throw new OperationNotSupportedException("Return type of condition executor " + leftConditionExecutor
                    .toString() + " should be of type BOOL. Actual Type: " + leftConditionExecutor.getReturnType()
                    .toString());
        } else if (!rightConditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {
            throw new OperationNotSupportedException("Return type of condition executor " +
                    rightConditionExecutor.toString() +
                    " should be of type BOOL. " +
                    "Actual Type: " +
                    rightConditionExecutor.getReturnType().toString());
        } else {
            throw new OperationNotSupportedException("Return type of condition executor " +
                    leftConditionExecutor.toString() +
                    " and condition executor" +
                    rightConditionExecutor.toString() +
                    "should be of type BOOL. Left executor: " +
                    leftConditionExecutor.getReturnType().toString()
                    + " Right executor: " +
                    rightConditionExecutor.getReturnType().toString());
        }
    }
}
 
Example 5
Source File: BoolConditionExpressionExecutor.java    From siddhi with Apache License 2.0 5 votes vote down vote up
public BoolConditionExpressionExecutor(ExpressionExecutor conditionExecutor) {
    if (conditionExecutor.getReturnType().equals(Attribute.Type.BOOL)) {
        this.conditionExecutor = conditionExecutor;
    } else {
        throw new OperationNotSupportedException("Return type of condition executor " + conditionExecutor
                .toString() + " should be of type BOOL. " +
                "Actual Type: " + conditionExecutor.getReturnType().toString());
    }
}