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

sqlancer.cockroachdb.ast.CockroachDBMultiValuedComparison Maven / Gradle / Ivy

Go to download

SQLancer finds logic bugs in Database Management Systems through automatic testing

There is a newer version: 2.0.0
Show newest version
package sqlancer.cockroachdb.ast;

import java.util.List;

import sqlancer.Randomly;

public class CockroachDBMultiValuedComparison implements CockroachDBExpression {

    private CockroachDBExpression left;
    private List right;
    private MultiValuedComparisonType type;
    private MultiValuedComparisonOperator op;

    public enum MultiValuedComparisonType {
        ANY, SOME, ALL;

        public static MultiValuedComparisonType getRandom() {
            return Randomly.fromOptions(values());
        }
    }

    public enum MultiValuedComparisonOperator {
        SMALLER("<"), GREATER(">"), EQUALS("="), SMALLER_EQUALS("<="), GREATER_EQUALS(">="), NOT_EQUALS("!=");

        private String stringRepr;

        MultiValuedComparisonOperator(String stringRepr) {
            this.stringRepr = stringRepr;
        }

        public String getStringRepr() {
            return stringRepr;
        }

        public static MultiValuedComparisonOperator getRandomGenericComparisonOperator() {
            return Randomly.fromOptions(SMALLER, GREATER);
        }
    }

    public CockroachDBMultiValuedComparison(CockroachDBExpression left, List right,
            MultiValuedComparisonType type, MultiValuedComparisonOperator op) {
        this.left = left;
        this.right = right;
        this.type = type;
        this.op = op;
    }

    public CockroachDBExpression getLeft() {
        return left;
    }

    public MultiValuedComparisonOperator getOp() {
        return op;
    }

    public List getRight() {
        return right;
    }

    public MultiValuedComparisonType getType() {
        return type;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy