Skip to content
Snippets Groups Projects
Commit 72b6f490 authored by Simon Spinner's avatar Simon Spinner
Browse files

Remove static helper functions for creation. Use constructors instead.

parent e57a6f0f
No related branches found
No related tags found
No related merge requests found
Showing
with 12 additions and 40 deletions
...@@ -14,7 +14,7 @@ public class InterfaceCommand extends ModelCommand<Repository, Interface> { ...@@ -14,7 +14,7 @@ public class InterfaceCommand extends ModelCommand<Repository, Interface> {
private final String interfaceName; private final String interfaceName;
private final List<SignatureCommand> signatures = new LinkedList<>(); private final List<SignatureCommand> signatures = new LinkedList<>();
private InterfaceCommand(String interfaceName) { public InterfaceCommand(String interfaceName) {
super(RepositoryPackage.Literals.REPOSITORY__INTERFACES, Interface.class); super(RepositoryPackage.Literals.REPOSITORY__INTERFACES, Interface.class);
this.interfaceName = interfaceName; this.interfaceName = interfaceName;
} }
...@@ -37,10 +37,6 @@ public class InterfaceCommand extends ModelCommand<Repository, Interface> { ...@@ -37,10 +37,6 @@ public class InterfaceCommand extends ModelCommand<Repository, Interface> {
return signatures; return signatures;
} }
public static InterfaceCommand _interface(String name) {
return new InterfaceCommand(name);
}
public InterfaceCommand add(SignatureCommand signature) { public InterfaceCommand add(SignatureCommand signature) {
signatures.add(signature); signatures.add(signature);
return this; return this;
......
...@@ -13,7 +13,7 @@ public class InterfaceProvidingRoleCommand extends ModelCommand<RepositoryCompon ...@@ -13,7 +13,7 @@ public class InterfaceProvidingRoleCommand extends ModelCommand<RepositoryCompon
private final String portName; private final String portName;
private final InterfaceCommand interfaceCmd; private final InterfaceCommand interfaceCmd;
private InterfaceProvidingRoleCommand(String portName, InterfaceCommand addInterface) { public InterfaceProvidingRoleCommand(String portName, InterfaceCommand addInterface) {
super(RepositoryPackage.Literals.INTERFACE_PROVIDING_ENTITY__INTERFACE_PROVIDING_ROLES, InterfaceProvidingRole.class); super(RepositoryPackage.Literals.INTERFACE_PROVIDING_ENTITY__INTERFACE_PROVIDING_ROLES, InterfaceProvidingRole.class);
this.portName = portName; this.portName = portName;
this.interfaceCmd = addInterface; this.interfaceCmd = addInterface;
...@@ -33,9 +33,4 @@ public class InterfaceProvidingRoleCommand extends ModelCommand<RepositoryCompon ...@@ -33,9 +33,4 @@ public class InterfaceProvidingRoleCommand extends ModelCommand<RepositoryCompon
providingRole.setInterface(interf); providingRole.setInterface(interf);
return providingRole; return providingRole;
} }
public static InterfaceProvidingRoleCommand interfaceProvidingRole(String portName, InterfaceCommand addInterface) {
return new InterfaceProvidingRoleCommand(portName, addInterface);
}
} }
...@@ -12,7 +12,7 @@ public class InterfaceRequiringRoleCommand extends ModelCommand<RepositoryCompon ...@@ -12,7 +12,7 @@ public class InterfaceRequiringRoleCommand extends ModelCommand<RepositoryCompon
private final String portName; private final String portName;
private final InterfaceCommand interfaceCmd; private final InterfaceCommand interfaceCmd;
private InterfaceRequiringRoleCommand(InterfaceCommand addInterface, String portName) { public InterfaceRequiringRoleCommand(InterfaceCommand addInterface, String portName) {
super(RepositoryPackage.Literals.INTERFACE_REQUIRING_ENTITY__INTERFACE_REQUIRING_ROLES, InterfaceRequiringRole.class); super(RepositoryPackage.Literals.INTERFACE_REQUIRING_ENTITY__INTERFACE_REQUIRING_ROLES, InterfaceRequiringRole.class);
this.portName = portName; this.portName = portName;
this.interfaceCmd = addInterface; this.interfaceCmd = addInterface;
...@@ -32,9 +32,5 @@ public class InterfaceRequiringRoleCommand extends ModelCommand<RepositoryCompon ...@@ -32,9 +32,5 @@ public class InterfaceRequiringRoleCommand extends ModelCommand<RepositoryCompon
requiringRole.setInterface(interf); requiringRole.setInterface(interf);
return requiringRole; return requiringRole;
} }
public static InterfaceRequiringRoleCommand interfaceRequiringRole(InterfaceCommand addInterface, String portName) {
return new InterfaceRequiringRoleCommand(addInterface, portName);
}
} }
...@@ -9,7 +9,7 @@ import tools.descartes.prisma.core.commands.ModelCommand; ...@@ -9,7 +9,7 @@ import tools.descartes.prisma.core.commands.ModelCommand;
public class RepositoryCommand extends ModelCommand<Repository, Repository> { public class RepositoryCommand extends ModelCommand<Repository, Repository> {
protected RepositoryCommand() { public RepositoryCommand() {
super(null, Repository.class); super(null, Repository.class);
} }
...@@ -26,10 +26,6 @@ public class RepositoryCommand extends ModelCommand<Repository, Repository> { ...@@ -26,10 +26,6 @@ public class RepositoryCommand extends ModelCommand<Repository, Repository> {
return repo; return repo;
} }
public static RepositoryCommand repository() {
return new RepositoryCommand();
}
public RepositoryCommand add(InterfaceCommand interf) { public RepositoryCommand add(InterfaceCommand interf) {
interfaces.add(interf); interfaces.add(interf);
return this; return this;
......
...@@ -14,11 +14,13 @@ import tools.descartes.prisma.core.commands.repository.SignatureCommand; ...@@ -14,11 +14,13 @@ import tools.descartes.prisma.core.commands.repository.SignatureCommand;
public class ExternalCallActionCommand extends AbstractActionCommand<ExternalCallAction> { public class ExternalCallActionCommand extends AbstractActionCommand<ExternalCallAction> {
private InterfaceRequiringRoleCommand requiringRoleCmd; private final InterfaceRequiringRoleCommand requiringRoleCmd;
private SignatureCommand signatureCmd; private final SignatureCommand signatureCmd;
protected ExternalCallActionCommand() { public ExternalCallActionCommand(InterfaceRequiringRoleCommand requiringRoleCmd, SignatureCommand signatureCmd) {
super(ExternalCallAction.class); super(ExternalCallAction.class);
this.requiringRoleCmd = requiringRoleCmd;
this.signatureCmd = signatureCmd;
} }
@Override @Override
......
...@@ -20,7 +20,7 @@ public class FineGrainedBehaviorCommand extends ModelCommand<BasicComponent, Fin ...@@ -20,7 +20,7 @@ public class FineGrainedBehaviorCommand extends ModelCommand<BasicComponent, Fin
private final InterfaceProvidingRoleCommand addProvidingRoleCmd; private final InterfaceProvidingRoleCommand addProvidingRoleCmd;
private final SignatureCommand addSignatureCmd; private final SignatureCommand addSignatureCmd;
private FineGrainedBehaviorCommand(InterfaceProvidingRoleCommand addProvidingRole, SignatureCommand addSignature) { public FineGrainedBehaviorCommand(InterfaceProvidingRoleCommand addProvidingRole, SignatureCommand addSignature) {
super(RepositoryPackage.Literals.BASIC_COMPONENT__FINE_GRAINED_BEHAVIOR, FineGrainedBehavior.class); super(RepositoryPackage.Literals.BASIC_COMPONENT__FINE_GRAINED_BEHAVIOR, FineGrainedBehavior.class);
this.addProvidingRoleCmd = addProvidingRole; this.addProvidingRoleCmd = addProvidingRole;
this.addSignatureCmd = addSignature; this.addSignatureCmd = addSignature;
...@@ -49,10 +49,6 @@ public class FineGrainedBehaviorCommand extends ModelCommand<BasicComponent, Fin ...@@ -49,10 +49,6 @@ public class FineGrainedBehaviorCommand extends ModelCommand<BasicComponent, Fin
return Collections.singletonList(internalBehaviorCmd); return Collections.singletonList(internalBehaviorCmd);
} }
public static FineGrainedBehaviorCommand fineGrainedBehavior(InterfaceProvidingRoleCommand addProvidingRole, SignatureCommand addSignature) {
return new FineGrainedBehaviorCommand(addProvidingRole, addSignature);
}
public void add(AbstractActionCommand<?> action) { public void add(AbstractActionCommand<?> action) {
internalBehaviorCmd.add(action); internalBehaviorCmd.add(action);
} }
......
package tools.descartes.prisma.core.commands.servicebehavior; package tools.descartes.prisma.core.commands.servicebehavior;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import edu.kit.ipd.descartes.mm.applicationlevel.parameterdependencies.ModelVariableCharacterizationType; import edu.kit.ipd.descartes.mm.applicationlevel.parameterdependencies.ModelVariableCharacterizationType;
...@@ -16,7 +15,7 @@ public class LoopActionCommand extends AbstractActionCommand<LoopAction> { ...@@ -16,7 +15,7 @@ public class LoopActionCommand extends AbstractActionCommand<LoopAction> {
private final ComponentInternalBehaviorCommand<LoopAction> loopBehaviorCmd = new ComponentInternalBehaviorCommand<>(ServicebehaviorPackage.Literals.LOOP_ACTION__LOOP_BODY_BEHAVIOR); private final ComponentInternalBehaviorCommand<LoopAction> loopBehaviorCmd = new ComponentInternalBehaviorCommand<>(ServicebehaviorPackage.Literals.LOOP_ACTION__LOOP_BODY_BEHAVIOR);
private LoopActionCommand() { public LoopActionCommand() {
super(LoopAction.class); super(LoopAction.class);
} }
...@@ -50,8 +49,4 @@ public class LoopActionCommand extends AbstractActionCommand<LoopAction> { ...@@ -50,8 +49,4 @@ public class LoopActionCommand extends AbstractActionCommand<LoopAction> {
public void add(AbstractActionCommand<?> cmd) { public void add(AbstractActionCommand<?> cmd) {
loopBehaviorCmd.add(cmd); loopBehaviorCmd.add(cmd);
} }
public static LoopActionCommand loop() {
return new LoopActionCommand();
}
} }
...@@ -14,7 +14,7 @@ public class SystemCommand extends ModelCommand<System, System> { ...@@ -14,7 +14,7 @@ public class SystemCommand extends ModelCommand<System, System> {
private final List<AssemblyContextCommand> assemblyContexts = new LinkedList<>(); private final List<AssemblyContextCommand> assemblyContexts = new LinkedList<>();
private final List<AssemblyConnectorCommand> assemblyConnectors = new LinkedList<>(); private final List<AssemblyConnectorCommand> assemblyConnectors = new LinkedList<>();
protected SystemCommand() { public SystemCommand() {
super(null, System.class); super(null, System.class);
} }
...@@ -28,10 +28,6 @@ public class SystemCommand extends ModelCommand<System, System> { ...@@ -28,10 +28,6 @@ public class SystemCommand extends ModelCommand<System, System> {
return system; return system;
} }
public static SystemCommand system() {
return new SystemCommand();
}
public SystemCommand add(AssemblyContextCommand assemblyContext) { public SystemCommand add(AssemblyContextCommand assemblyContext) {
assemblyContexts.add(assemblyContext); assemblyContexts.add(assemblyContext);
return this; return this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment