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

fr.vergne.pester.util.namer.PredicateNamer 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 PredicateNamer implements Namer {
	private final String defaultName;
	private final Predicate namePredicate;

	public PredicateNamer(String defaultName, Predicate namePredicate) {
		this.defaultName = ArgsCheck.requireNonNull(defaultName, "No default name provided");
		this.namePredicate = ArgsCheck.requireNonNull(namePredicate, "No name predicate provided");
	}

	@Override
	public Optional getExpectedName() {
		return Optional.empty();
	}

	@Override
	public Predicate getNamePredicate() {
		return namePredicate;
	}

	@Override
	public String getDefaultName() {
		return defaultName;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy