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

de.ec.sql.ConditionValue Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
package de.ec.sql;

import de.ec.sql.ConditionPart.Operator;
import lombok.AccessLevel;
import lombok.Getter;

@Getter(AccessLevel.PROTECTED)
public class ConditionValue> {

	private final ConditionPart part;
	private final Operator operator;
	private Object value;
	private boolean column = false;
	private boolean expression = false;

	protected ConditionValue(final ConditionPart part, final Operator operator) {
		this.part = part;
		this.operator = operator;
	}

	public T value(final Object value) {
		return op(value, false, false);
	}

	public T col(final String column) {
		return op(column, true, false);
	}

	public T expr(final String expr) {
		return op(expr, false, true);
	}

	private T op(final Object value, final boolean column, final boolean expr) {
		this.value = value;
		this.column = column;
		this.expression = expr;
		return part.condition(this);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy