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

fr.vergne.pester.util.namer.NameNamer Maven / Gradle / Ivy

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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy