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

io.github.bekoenig.assertj.schemacrawler.api.AbstractNamedObjectAssert Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package io.github.bekoenig.assertj.schemacrawler.api;

import org.assertj.core.api.AbstractComparableAssert;
import schemacrawler.schema.NamedObject;
import schemacrawler.schema.NamedObjectKey;

import java.util.function.Predicate;

public abstract class AbstractNamedObjectAssert<
        SELF extends AbstractNamedObjectAssert, ACTUAL extends NamedObject>
        extends AbstractComparableAssert {

    protected AbstractNamedObjectAssert(ACTUAL actual, Class selfType) {
        super(actual, selfType);
    }

    public SELF matchesName(Predicate predicate) {
        extracting(NamedObject::getName).matches(predicate);
        return myself;
    }

    public SELF hasName(String name) {
        return matchesName(Predicate.isEqual(name));
    }

    public SELF matchesFullName(Predicate predicate) {
        extracting(NamedObject::getFullName).matches(predicate);
        return myself;
    }

    public SELF hasFullName(String fullName) {
        return matchesFullName(Predicate.isEqual(fullName));
    }

    public SELF matchesKey(Predicate predicate) {
        extracting(NamedObject::key).matches(predicate);
        return myself;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy