@Test public void testNoModifiers(@TuneProvider(NO_MODIFIERS) Tune tune) { TypeSpec.Builder builder = TypeSpec.classBuilder("Test"); TypeModel model = new TypeModel(); new ModifiersHandler(tune, null, null).process(builder, model); TypeSpec spec = builder.build(); assertEquals("Test", spec.name, "Wrong class name found"); Set<Modifier> modifiers = spec.modifiers; assertEquals(0, modifiers.size(), "Modifiers found"); }
@Override public void process(TypeSpec.Builder typeBuilder, TypeModel typeModel) { if (typeModel.getModifiers().length == 0 && tune.getDefaultClassModifier() != null) { typeBuilder.addModifiers(tune.getDefaultClassModifier()); } else { typeBuilder.addModifiers(typeModel.getModifiers()); } }
ModifiersHandler extends Handler { @Override public void process(TypeSpec.Builder typeBuilder, TypeModel typeModel) { if (typeModel.getModifiers().length == 0 && tune.getDefaultClassModifier() != null) { typeBuilder.addModifiers(tune.getDefaultClassModifier()); } else { typeBuilder.addModifiers(typeModel.getModifiers()); } } }
ModifiersHandler extends Handler { @Override public void process(TypeSpec.Builder typeBuilder, TypeModel typeModel) { if (typeModel.getModifiers().length == 0 && tune.getDefaultClassModifier() != null) { typeBuilder.addModifiers(tune.getDefaultClassModifier()); } else { typeBuilder.addModifiers(typeModel.getModifiers()); } } ModifiersHandler(Tune tune, MetaInfo metaInfo, RuleSet ruleSet); }
ModifiersHandler extends Handler { @Override public void process(TypeSpec.Builder typeBuilder, TypeModel typeModel) { if (typeModel.getModifiers().length == 0 && tune.getDefaultClassModifier() != null) { typeBuilder.addModifiers(tune.getDefaultClassModifier()); } else { typeBuilder.addModifiers(typeModel.getModifiers()); } } ModifiersHandler(Tune tune, MetaInfo metaInfo, RuleSet ruleSet); @Override void process(TypeSpec.Builder typeBuilder, TypeModel typeModel); }
ModifiersHandler extends Handler { @Override public void process(TypeSpec.Builder typeBuilder, TypeModel typeModel) { if (typeModel.getModifiers().length == 0 && tune.getDefaultClassModifier() != null) { typeBuilder.addModifiers(tune.getDefaultClassModifier()); } else { typeBuilder.addModifiers(typeModel.getModifiers()); } } ModifiersHandler(Tune tune, MetaInfo metaInfo, RuleSet ruleSet); @Override void process(TypeSpec.Builder typeBuilder, TypeModel typeModel);  }