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

net.amygdalum.testrecorder.runtime.EnumMatcher Maven / Gradle / Ivy

The newest version!
package net.amygdalum.testrecorder.runtime;

import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;

public class EnumMatcher extends TypeSafeMatcher> {

	private String name;

	public EnumMatcher(String name) {
		this.name = name;
	}

	@Override
	public void describeTo(Description description) {
		description.appendText("with name ").appendValue(name);
	}

	@Override
	protected boolean matchesSafely(Enum item) {
		return name.equals(item.name());
	}

	public static EnumMatcher matchingEnum(String name) {
		return new EnumMatcher(name);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy