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

org.yx.common.matcher.BooleanMatcher Maven / Gradle / Ivy

There is a newer version: 4.0.2
Show newest version
package org.yx.common.matcher;

import java.util.function.Predicate;

public enum BooleanMatcher implements Predicate {

	FALSE(false), TRUE(true);

	private final boolean matched;

	private BooleanMatcher(boolean matched) {
		this.matched = matched;
	}

	@Override
	public boolean test(String text) {
		return matched;
	}

	@Override
	public Predicate negate() {
		return this.matched ? FALSE : TRUE;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy