private boolean isSetterForField ( ExecutableElement setter , VariableElement field ) { return setter . getParameters ( ) != null && setter . getParameters ( ) . size ( ) == 1 && setter . getParameters ( ) . get ( 0 ) . asType ( ) . equals ( field . asType ( ) ) ; // TODO inheritance? TypeUtils is applicable? }
Checks if the setter method is valid for the given field