de.jaggl.sqlbuilder.conditions.IsLike Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlbuilder-core Show documentation
Show all versions of sqlbuilder-core Show documentation
A Java-Library to build SQL-Statements
package de.jaggl.sqlbuilder.conditions;
import static de.jaggl.sqlbuilder.utils.BuilderUtils.buildLikePart;
import static de.jaggl.sqlbuilder.utils.BuilderUtils.getValued;
import java.text.MessageFormat;
import de.jaggl.sqlbuilder.domain.BuildingContext;
import de.jaggl.sqlbuilder.domain.LikeType;
import de.jaggl.sqlbuilder.utils.Indentation;
import lombok.AllArgsConstructor;
import lombok.ToString;
/**
* @author Martin Schumacher
*
* @since 2.0.0
*/
@AllArgsConstructor
@ToString(callSuper = true)
public class IsLike extends Condition
{
private Object value1;
private Object value2;
private LikeType likeType;
@Override
protected String doBuild(BuildingContext context, Indentation indentation)
{
return MessageFormat
.format(context.getDialect()
.getLabels()
.getIsLike(), getValued(value1, context, indentation), buildLikePart(value2, likeType, context, indentation));
}
}