@Test public void testNotDeprecatedField() { FieldSpec.Builder builder = FieldSpec.builder(Integer.class, "test"); FieldModel model = mock(FieldModel.class); when(model.isDeprecated()).thenReturn(false); new DeprecatedRule(null, null).process(builder, model); FieldSpec fieldSpec = builder.build(); assertEquals("test", fieldSpec.name); assertEquals(0, fieldSpec.annotations.size()); }
@Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (!fieldModel.isDeprecated()) { return; } fieldSpec.addAnnotation(Deprecated.class); }
DeprecatedRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (!fieldModel.isDeprecated()) { return; } fieldSpec.addAnnotation(Deprecated.class); } }
DeprecatedRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (!fieldModel.isDeprecated()) { return; } fieldSpec.addAnnotation(Deprecated.class); } DeprecatedRule(Tune tune, MetaInfo metaInfo); }
DeprecatedRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (!fieldModel.isDeprecated()) { return; } fieldSpec.addAnnotation(Deprecated.class); } DeprecatedRule(Tune tune, MetaInfo metaInfo); @Override void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel); }
DeprecatedRule extends FieldRule { @Override public void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel) { if (!fieldModel.isDeprecated()) { return; } fieldSpec.addAnnotation(Deprecated.class); } DeprecatedRule(Tune tune, MetaInfo metaInfo); @Override void process(FieldSpec.Builder fieldSpec, FieldModel fieldModel);  }