
org.xpertss.proximo.matchers.InstanceOf Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proximo Show documentation
Show all versions of proximo Show documentation
Proximo provides a simple declarative means for creating proxies and stubbing method behavior overrides.
The newest version!
/**
* Copyright 2015 XpertSoftware
*
* Created By: cfloersch
* Date: 6/3/2015
*/
package org.xpertss.proximo.matchers;
import xpertss.proximo.Matcher;
import java.io.Serializable;
public class InstanceOf implements Matcher, Serializable {
private static final long serialVersionUID = 517358915876138366L;
private final Class> clazz;
public InstanceOf(Class> clazz) {
this.clazz = clazz;
}
public boolean matches(Object actual) {
return (actual != null) && clazz.isAssignableFrom(actual.getClass());
}
@Override
public int specificity() { return (clazz == Object.class) ? ANY_SPECIFICITY : INSTANCE_SPECIFICITY; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy