Code example for Field

Methods: getType

0
    public TypedPropertyCriteria(Class<?> propertyClass) {
        this.propertyClass = propertyClass;
    } 
 
    public boolean fieldMatches(Field f) {
        return propertyClass.equals(f.getType());
    } 
 
    public boolean methodMatches(Method m) {
        return propertyClass.equals(m.getReturnType());
    } 
}