Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.kasource.commons.reflection.filter.fields;
 
Filters fields which type is assignable to a specific class.

Note: It's not recommended to use this class directly, instead use the org.kasource.commons.reflection.FieldFilterBuilder.

Author(s):
rikardwi
public class AssignableToFieldFilter implements FieldFilter {

    
Interface or super class to test candidates with
    private Class<?> assignable;
    
    public AssignableToFieldFilter(Class<?> assignable) {
        this. = assignable;
    }
    
    @Override
    public boolean passFilter(Field field) {
        return field.getType().isAssignableFrom();
    }
New to GrepCode? Check out our FAQ X