com.github.rutledgepaulv.qbuilders.delegates.concrete.StringPropertyDelegate Maven / Gradle / Ivy
package com.github.rutledgepaulv.qbuilders.delegates.concrete;
import com.github.rutledgepaulv.qbuilders.builders.QBuilder;
import com.github.rutledgepaulv.qbuilders.conditions.Condition;
import com.github.rutledgepaulv.qbuilders.delegates.virtual.ListablePropertyDelegate;
import com.github.rutledgepaulv.qbuilders.operators.ComparisonOperator;
import com.github.rutledgepaulv.qbuilders.properties.concrete.StringProperty;
import com.github.rutledgepaulv.qbuilders.structures.FieldPath;
import java.util.Collections;
public final class StringPropertyDelegate>
extends ListablePropertyDelegate implements StringProperty {
public StringPropertyDelegate(FieldPath field, T canonical) {
super(field, canonical);
}
public final Condition lexicallyAfter(String value) {
return condition(getField(), ComparisonOperator.GT, Collections.singletonList(value));
}
public final Condition lexicallyBefore(String value) {
return condition(getField(), ComparisonOperator.LT, Collections.singletonList(value));
}
public final Condition lexicallyNotAfter(String value) {
return condition(getField(), ComparisonOperator.LTE, Collections.singletonList(value));
}
public final Condition lexicallyNotBefore(String value) {
return condition(getField(), ComparisonOperator.GTE, Collections.singletonList(value));
}
public Condition pattern(String pattern) {
return condition(getField(), ComparisonOperator.RE, Collections.singletonList(pattern));
}
}