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

br.com.objectos.sql.SimpleSelectWhere11String Maven / Gradle / Ivy

package br.com.objectos.sql;

import br.com.objectos.db.Condition;
import br.com.objectos.db.Selectable;
import br.com.objectos.db.StringTypeColumn;
import br.com.objectos.db.Variable;
import java.util.Objects;
import javax.annotation.Generated;

@Generated("br.com.objectos.sql.BootProcessor")
public final class SimpleSelectWhere11String extends AbstractSimpleSelectWhere11 implements SimpleSelectWhereString, V> {
  final Keyword keyword;

  private final V first;

  SimpleSelectWhere11String(SelectNode> previous, Keyword keyword, V first) {
    super(previous);
    this.keyword = keyword;
    this.first = first;
  }

  @Override
  public SimpleSelectWhere11 eq(String value) {
    return comparison(StringComparison.EQ, value);
  }

  @Override
  public SimpleSelectWhere11 eq(StringTypeColumn column) {
    return comparison(StringComparison.EQ, column);
  }

  @Override
  public Object eq(Variable variable) {
    return comparison(StringComparison.EQ, variable);
  }

  @Override
  public Object like(Variable variable) {
    return comparison(StringComparison.LIKE, variable);
  }

  @Override
  public Object notLike(Variable variable) {
    return comparison(StringComparison.NOT_LIKE, variable);
  }

  @Override
  Condition condition() {
    return StringComparison.EQ.ofColumn(first);
  }

  private SimpleSelectWhere11 comparison(StringComparison operator, String value) {
    Objects.requireNonNull(value);
    Condition condition = operator.ofColumn(first.withValue(value));
    return new SimpleSelectWhere11<>(this, condition);
  }

  private SimpleSelectWhere11 comparison(StringComparison operator, StringTypeColumn column) {
    Objects.requireNonNull(column);
    Condition condition = operator.ofColumn(first, column);
    return new SimpleSelectWhere11<>(this, condition);
  }

  private Object comparison(StringComparison operator, Variable variable) {
    throw new UnsupportedOperationException();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy