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

jaskell.sql.Not Maven / Gradle / Ivy

Go to download

This is a utils library for java 8 project. It include parsec combinators and sql generators library.

There is a newer version: 2.9.2
Show newest version
package jaskell.sql;

import jaskell.script.Directive;
import jaskell.script.Parameter;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

public class Not extends Predicate {
    Optional _predicate;
    Not(Directive predicate){
        _predicate = Optional.of(predicate);
    }

    Not(){
        _predicate = Optional.empty();
    }

    @Override
    public String script() {
        if (_predicate.isPresent()){
            return String.format("NOT(%s)", _predicate.get().script());
        } else {
            return "NOT ";
        }
    }

    @Override
    public List> parameters() {
        if(_predicate.isPresent()){
            return _predicate.get().parameters();
        } else {
            return new ArrayList<>();
        }
    }

    public Exists exists(Directive directive) {
        Exists re = new Exists(directive);
        re._prefix = Optional.of(this);
        return re;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy