@Test public void processRequiredRuleForSetters() { MethodSpec.Builder builder = MethodSpec.methodBuilder("test"); ParameterSpec.Builder parameterBuilder = ParameterSpec.builder(String.class, "one"); FieldModel model = mock(FieldModel.class); new Jsr303Style().processRequiredRuleForSetters(builder, model, parameterBuilder); MethodSpec methodSpec = builder.build(); assertEquals("test", methodSpec.name); assertEquals(0, methodSpec.annotations.size()); ParameterSpec parameterSpec = parameterBuilder.build(); assertEquals("one", parameterSpec.name); assertEquals(1, parameterSpec.annotations.size()); }
@Override public void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec) { parameterSpec.addAnnotation(NotNull.class); }
Jsr303Style extends ValidationAnnotatorStyle { @Override public void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec) { parameterSpec.addAnnotation(NotNull.class); } }
Jsr303Style extends ValidationAnnotatorStyle { @Override public void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec) { parameterSpec.addAnnotation(NotNull.class); }  }
Jsr303Style extends ValidationAnnotatorStyle { @Override public void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec) { parameterSpec.addAnnotation(NotNull.class); }  @Override void processRequiredRule(FieldSpec.Builder fieldSpec, FieldModel fieldModel); @Override void processRequiredRuleForGetters(MethodSpec.Builder methodSpec, FieldModel fieldModel); @Override void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec); @Override void processNotRequiredRule(FieldSpec.Builder fieldSpec, FieldModel fieldModel); @Override void processNotRequiredRuleForGetters(MethodSpec.Builder methodSpec, FieldModel fieldModel); @Override void processNotRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder param); @Override void processRequiredRuleForConstructor(ParameterSpec.Builder parameterSpec); @Override void processNotRequiredRuleForConstructor(ParameterSpec.Builder parameterSpec); }
Jsr303Style extends ValidationAnnotatorStyle { @Override public void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec) { parameterSpec.addAnnotation(NotNull.class); }  @Override void processRequiredRule(FieldSpec.Builder fieldSpec, FieldModel fieldModel); @Override void processRequiredRuleForGetters(MethodSpec.Builder methodSpec, FieldModel fieldModel); @Override void processRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder parameterSpec); @Override void processNotRequiredRule(FieldSpec.Builder fieldSpec, FieldModel fieldModel); @Override void processNotRequiredRuleForGetters(MethodSpec.Builder methodSpec, FieldModel fieldModel); @Override void processNotRequiredRuleForSetters(MethodSpec.Builder methodSpec, FieldModel fieldModel, ParameterSpec.Builder param); @Override void processRequiredRuleForConstructor(ParameterSpec.Builder parameterSpec); @Override void processNotRequiredRuleForConstructor(ParameterSpec.Builder parameterSpec);  }