package de.dhbwstuttgart.target.tree; import de.dhbwstuttgart.parser.scope.JavaClassName; import de.dhbwstuttgart.target.tree.expression.TargetBlock; import de.dhbwstuttgart.target.tree.type.TargetRefType; import de.dhbwstuttgart.target.tree.type.TargetType; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public record TargetClass(int modifiers, JavaClassName qualifiedName, TargetType superType, Set generics, Set txGenerics, List implementingInterfaces, List constructors, TargetMethod staticConstructor, List fields, List methods) implements TargetStructure { public TargetClass(int modifiers, JavaClassName qualifiedName) { this(modifiers, qualifiedName, TargetType.Object, new HashSet<>(), new HashSet<>(), new ArrayList<>(), new ArrayList<>(), null, new ArrayList<>(), new ArrayList<>()); } public TargetClass(int modifiers, JavaClassName qualifiedName, List implementingInterfaces) { this(modifiers, qualifiedName, TargetType.Object, new HashSet<>(), new HashSet<>(), implementingInterfaces, new ArrayList<>(), null, new ArrayList<>(), new ArrayList<>()); } public void addField(int access, TargetRefType type, String name) { this.fields.add(new TargetField(access, type, name)); } }