io.github.bekoenig.assertj.schemacrawler.api.AbstractBaseColumnAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-schemacrawler Show documentation
Show all versions of assertj-schemacrawler Show documentation
An assertj extension for schema-crawler.
package io.github.bekoenig.assertj.schemacrawler.api;
import schemacrawler.schema.BaseColumn;
import schemacrawler.schema.ColumnDataType;
import schemacrawler.schema.DatabaseObject;
import java.util.function.Consumer;
import java.util.function.Predicate;
public abstract class AbstractBaseColumnAssert<
SELF extends AbstractBaseColumnAssert,
ACTUAL extends BaseColumn,
PARENT extends DatabaseObject>
extends AbstractDependantObjectAssert {
protected AbstractBaseColumnAssert(ACTUAL actual, Class> selfType) {
super(actual, selfType);
}
public SELF satisfiesColumnDataType(Consumer requirement) {
extracting(BaseColumn::getColumnDataType).satisfies(requirement);
return myself;
}
public SELF matchesDecimalDigits(Predicate predicate) {
extracting(BaseColumn::getDecimalDigits).matches(predicate);
return myself;
}
public SELF matchesOrdinalPosition(Predicate predicate) {
extracting(BaseColumn::getOrdinalPosition).matches(predicate);
return myself;
}
public SELF matchesSize(Predicate predicate) {
extracting(BaseColumn::getSize).matches(predicate);
return myself;
}
public SELF satisfiesType(Consumer requirement) {
extracting(BaseColumn::getType).satisfies(requirement);
return myself;
}
public SELF matchesWidth(Predicate predicate) {
extracting(BaseColumn::getWidth).matches(predicate);
return myself;
}
public SELF isColumnDataTypeKnown(boolean expected) {
return returns(expected, BaseColumn::getColumnDataType);
}
public SELF isNullable(boolean expected) {
return returns(expected, BaseColumn::isNullable);
}
}