.withParameters(parameters) .withConstructors(constructors) .withMethods(methods) .withProperties(properties) .withExtendsList(extendsList)
.withExtendsList(superClass) .withProperties(fields) .withMethods(methods) .build();
public TypeDef apply(Node<TypeDef> item) { List<ClassRef> interfaces = new ArrayList<ClassRef>(); for (Node<TypeDef> child : item.getTransitions()) { ClassRef transitionInterface = TO_TRANSITION.apply(child); interfaces.add(transitionInterface); CodegenContext.getContext().getDefinitionRepository().register(child.getItem(), IS_GENERATED); } TypeDef rootType = new TypeDefBuilder(item.getItem()) .withExtendsList(interfaces) .withParameters() .withMethods() .build(); return new TypeDefBuilder(Generics.UNWRAP.apply(rootType)) .withMethods(new ArrayList<Method>()) .build(); } };
.withAnnotations() .withProperties(properties) .withMethods(nestedMethods) .withConstructors(constructors) .build();
.withKind(Kind.INTERFACE) .withModifiers(TypeUtils.modifiersToInt(Modifier.PUBLIC)) .withMethods(methods) .build());
.withAnnotations() .withInnerTypes(nestedClazzes) .withMethods(methods) .build();
.withProperties(properties) .withInnerTypes(nestedClazzes) .withMethods(methods) .build());
public TypeDef apply(TypeDef item) { List<TypeParamDef> parameters = new ArrayList<TypeParamDef>(); for (TypeParamDef generic : item.getParameters()) { parameters.add(generic); } return new TypeDefBuilder(item) .withKind(Kind.CLASS) .withModifiers(TypeUtils.modifiersToInt(Modifier.PUBLIC)) .withName("Editable" + item.getName()) .withParameters(parameters) .withExtendsList(item.toInternalReference()) .withImplementsList(BuilderContextManager.getContext().getEditableInterface().toReference(SHALLOW_BUILDER.apply(item).toInternalReference())) .withInnerTypes() .withProperties() .withMethods() .withConstructors() .build(); } };
.withProperties(fields) .withConstructors(constructors) .withMethods(getters) .withImplementsList(implementsList) .withExtendsList(extendsList) .withPackageName(adapterPackage) .withName(!StringUtils.isNullOrEmpty(name) ? name : StringUtils.toPojoName(generatedPojo.getName(), prefix, suffix)) .withMethods(adapterMethods) .addToAttributes(ALSO_IMPORT, adapterImports) .build();
.withModifiers(TypeUtils.modifiersToInt(Modifier.PUBLIC)) .withProperties(properties) .withMethods(nestedMethods) .withConstructors(constructors) .build();
.withName(scopeInterface.getDefinition().getName() + SCOPE_SUFFIX) .withExtendsList(scopeInterface) .withMethods() .addToAttributes(CARDINALITY_MULTIPLE, multiple) .addToAttributes(KEYWORDS, scopeKeywords(scopeClasses))
.withModifiers(TypeUtils.modifiersToInt(modifiers)) .withConstructors(constructors) .withMethods(methods) .addToAttributes(BUILDABLE_ENABLED, true) .addToAttributes(GENERATED, true) // We want to know that its a generated type...
.withImplementsList(implementsList) .withProperties(properties) .withMethods(methods) .withConstructors(constructors) .addToAttributes(TypeDef.ALSO_IMPORT, IMPORTS.apply(type))
public TypeDefBuilder(TypeDef instance,Boolean validationEnabled){ this.fluent = this; this.withKind(instance.getKind()); this.withPackageName(instance.getPackageName()); this.withName(instance.getName()); this.withComments(instance.getComments()); this.withAnnotations(instance.getAnnotations()); this.withExtendsList(instance.getExtendsList()); this.withImplementsList(instance.getImplementsList()); this.withParameters(instance.getParameters()); this.withProperties(instance.getProperties()); this.withConstructors(instance.getConstructors()); this.withMethods(instance.getMethods()); this.withOuterType(instance.getOuterType()); this.withInnerTypes(instance.getInnerTypes()); this.withModifiers(instance.getModifiers()); this.withAttributes(instance.getAttributes()); this.validationEnabled = validationEnabled; }
.withImplementsList(inlineTypeRef) .withProperties() .withMethods() .withConstructors().build();
.withProperties(fields) .withConstructors(constructors) .withMethods(methods) .build());