Linkage #20

Zusammengeführt
Lixfel hat 24 Commits von Linkage nach master 2022-09-23 12:45:21 +02:00 zusammengeführt
Nur Änderungen aus Commit a25ea3878d werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -33,7 +33,7 @@ public class BuildPlan implements Writer {
private Set<String> imports = new HashSet<>();
private final String className;
private Map<String, FieldBuilder> fieldBuilderMap = new HashMap<>();
private List<FieldBuilder> fieldBuilders = new ArrayList<>();
private Map<String, MethodBuilder> methodBuilderMap = new HashMap<>();
private List<String> staticLines = new ArrayList<>();
@ -42,15 +42,7 @@ public class BuildPlan implements Writer {
}
public void addField(FieldBuilder fieldBuilder) {
fieldBuilderMap.putIfAbsent(fieldBuilder.getType(), fieldBuilder);
}
public boolean hasField(String type) {
return fieldBuilderMap.containsKey(type);
}
public String getFieldName(String type) {
return fieldBuilderMap.get(type).getFieldName();
fieldBuilders.add(fieldBuilder);
}
public void addMethod(MethodBuilder methodBuilder) {
@ -76,8 +68,8 @@ public class BuildPlan implements Writer {
}
writer.write("\n");
writer.write("public class " + className + " {\n");
if (!fieldBuilderMap.isEmpty()) {
for (FieldBuilder fieldBuilder : fieldBuilderMap.values()) {
if (!fieldBuilders.isEmpty()) {
for (FieldBuilder fieldBuilder : fieldBuilders) {
fieldBuilder.write(writer);
}
writer.write("\n");