package designPatternExtensions;
import models.objectOrientedTransfer.*;
//https://github.com/iluwatar/java-design-patterns/tree/master/decorator
//
public class Decorator {
public static DataTransferDesign create() throws IllegalRelationException {
ObjectNode simpleTroll = new ObjectNode("SimpleTroll");
ObjectNode client = new ObjectNode("Client");
ObjectNode data = new ObjectNode("Int");
Relation transferRelation = new Relation(simpleTroll, client, MultiplicityValue.OneToOne);
DataTransferContext context = new DataTransferContext(
new java.util.ArrayList<>(), transferRelation, data, "attackPower", PushPullValue.PULL
);
DataTransferDesign design = new DataTransferDesign(context);
ObjectNode clubbedTroll = new ObjectNode("ClubbedTroll");
MediatorInsertion mi = new MediatorInsertion(client, simpleTroll, clubbedTroll);
design.addMediatorInsertion(mi);
InterfaceNode troll = new InterfaceNode(clubbedTroll, "Troll");
DependencyInversion di1 = new DependencyInversion(clubbedTroll, troll, client);
design.addDependencyInversion(di1);
DependencyInversion di2 = new DependencyInversion(simpleTroll, troll);
design.addDependencyInversion(di2);
return design;
}
}