fr.vergne.pester.util.namer.NameNamer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pester-core Show documentation
Show all versions of pester-core Show documentation
Implementation of the Pester library.
The newest version!
package fr.vergne.pester.util.namer;
import java.util.Optional;
import java.util.function.Predicate;
import fr.vergne.pester.util.argscheck.ArgsCheck;
public class NameNamer implements Namer {
private final String name;
public NameNamer(String name) {
this.name = ArgsCheck.requireNonNullNorEmpty(name, "No name provided");
}
@Override
public Optional getExpectedName() {
return Optional.of(name);
}
@Override
public Predicate getNamePredicate() {
return Predicate.isEqual(name);
}
@Override
public String getDefaultName() {
return name;
}
}