Dieser Commit ist enthalten in:
Ursprung
9eb18d9626
Commit
a25ea3878d
@ -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");
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren