@Test public void testNoParsers(@TuneProvider Tune tune) { TypeSpec.Builder builder = TypeSpec.classBuilder("Test"); TypeModel model = mock(TypeModel.class); List<String> fieldOrder = Arrays.asList("one", "two"); when(model.getFieldOrder()).thenReturn(fieldOrder); new PropertyOrderRule(tune, null).process(builder, model); TypeSpec spec = builder.build(); assertEquals("Test", spec.name, "Wrong name found."); assertEquals(0, spec.annotations.size(), "Annotations found."); }
@Override public void process(TypeSpec.Builder typeSpec, TypeModel typeModel) { if (typeModel.getFieldOrder() == null || typeModel.getFieldOrder().isEmpty()) { return; } tune.getAnnotatorStyles().forEach(style -> style.processPropertyOrderRule(typeSpec, typeModel)); }
PropertyOrderRule extends TypeRule { @Override public void process(TypeSpec.Builder typeSpec, TypeModel typeModel) { if (typeModel.getFieldOrder() == null || typeModel.getFieldOrder().isEmpty()) { return; } tune.getAnnotatorStyles().forEach(style -> style.processPropertyOrderRule(typeSpec, typeModel)); } }
PropertyOrderRule extends TypeRule { @Override public void process(TypeSpec.Builder typeSpec, TypeModel typeModel) { if (typeModel.getFieldOrder() == null || typeModel.getFieldOrder().isEmpty()) { return; } tune.getAnnotatorStyles().forEach(style -> style.processPropertyOrderRule(typeSpec, typeModel)); } PropertyOrderRule(Tune tune, MetaInfo metaInfo); }
PropertyOrderRule extends TypeRule { @Override public void process(TypeSpec.Builder typeSpec, TypeModel typeModel) { if (typeModel.getFieldOrder() == null || typeModel.getFieldOrder().isEmpty()) { return; } tune.getAnnotatorStyles().forEach(style -> style.processPropertyOrderRule(typeSpec, typeModel)); } PropertyOrderRule(Tune tune, MetaInfo metaInfo); @Override void process(TypeSpec.Builder typeSpec, TypeModel typeModel); }
PropertyOrderRule extends TypeRule { @Override public void process(TypeSpec.Builder typeSpec, TypeModel typeModel) { if (typeModel.getFieldOrder() == null || typeModel.getFieldOrder().isEmpty()) { return; } tune.getAnnotatorStyles().forEach(style -> style.processPropertyOrderRule(typeSpec, typeModel)); } PropertyOrderRule(Tune tune, MetaInfo metaInfo); @Override void process(TypeSpec.Builder typeSpec, TypeModel typeModel);  }