com.pivotallabs.greatexpectations.matchers.ObjectMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of great-expectations Show documentation
Show all versions of great-expectations Show documentation
Jasmine-style expect() for Java.
The newest version!
package com.pivotallabs.greatexpectations.matchers;
import com.pivotallabs.greatexpectations.AllowActualToBeNull;
import com.pivotallabs.greatexpectations.BaseMatcher;
import com.pivotallabs.greatexpectations.MatcherOf;
@MatcherOf(Object.class)
public class ObjectMatcher> extends BaseMatcher {
public boolean toEqual(T expected) {
return actual.equals(expected);
}
public boolean toBe(T expected) {
return actual == expected;
}
public boolean toBeInstanceOf(Class extends T> expected) {
return expected.isAssignableFrom(actual.getClass());
}
@AllowActualToBeNull
public boolean toBeNull() {
return actual == null;
}
}