Class NetworkBuilder
- java.lang.Object
-
- io.patriot_framework.network.simulator.api.builder.NetworkBuilder
-
public class NetworkBuilder extends Object
TopologyNetwork Builder provides functions for building network and adding it into topology. TopologyNetwork Builder have to cooperate with CalcRouteBuilder and Topology builder.
-
-
Field Summary
Fields Modifier and Type Field Description CalculatedRouteList<CalcRoute>
calcRoutes
CalculatedRouteList is list with routes to other networks, usually created with CalcRouteBuilder.
-
Constructor Summary
Constructors Constructor Description NetworkBuilder(TopologyBuilder topologyBuilder, String name)
Instantiates a new TopologyNetwork builder.NetworkBuilder(String name)
Instantiates a new TopologyNetwork builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopologyNetwork
build()
Builds network object.TopologyBuilder
create()
Builds network and adds it into topology.NetworkBuilder
docker()
Sets docker as network creator.CalcRouteBuilder
withCalcRoute()
Instantiates new CalcRouteBuilder used to create calcRoutes.NetworkBuilder
withCalcRoutes(CalculatedRouteList<CalcRoute> calcRoutes)
Add calcRoutes attribute to network.NetworkBuilder
withCreator(String creator)
NetworkBuilder
withInternet(Boolean internet)
Add internet attribute to network.NetworkBuilder
withIP(String ip)
Add ip attribute to network.NetworkBuilder
withMask(Integer mask)
Add mask attribute to network.
-
-
-
Field Detail
-
calcRoutes
public CalculatedRouteList<CalcRoute> calcRoutes
CalculatedRouteList is list with routes to other networks, usually created with CalcRouteBuilder.
-
-
Constructor Detail
-
NetworkBuilder
public NetworkBuilder(TopologyBuilder topologyBuilder, String name)
Instantiates a new TopologyNetwork builder.- Parameters:
topologyBuilder
- the topologyBuildername
- the network name.
-
NetworkBuilder
public NetworkBuilder(String name)
Instantiates a new TopologyNetwork builder.- Parameters:
name
- the network name.
-
-
Method Detail
-
withIP
public NetworkBuilder withIP(String ip)
Add ip attribute to network.- Parameters:
ip
- the ip- Returns:
- the network builder
-
withMask
public NetworkBuilder withMask(Integer mask)
Add mask attribute to network.- Parameters:
mask
- the mask- Returns:
- the network builder
-
withInternet
public NetworkBuilder withInternet(Boolean internet)
Add internet attribute to network. If this network is last step between your ws and topology, network must have attribute internet sets to true!- Parameters:
internet
- the internet- Returns:
- the network builder
-
withCreator
public NetworkBuilder withCreator(String creator)
-
withCalcRoutes
public NetworkBuilder withCalcRoutes(CalculatedRouteList<CalcRoute> calcRoutes)
Add calcRoutes attribute to network.- Parameters:
calcRoutes
- the calc routes- Returns:
- the network builder
-
withCalcRoute
public CalcRouteBuilder withCalcRoute()
Instantiates new CalcRouteBuilder used to create calcRoutes.- Returns:
- new CalcRouteBuilder
-
docker
public NetworkBuilder docker()
Sets docker as network creator.- Returns:
- the network builder
-
build
public TopologyNetwork build()
Builds network object.- Returns:
- the network
-
create
public TopologyBuilder create()
Builds network and adds it into topology.- Returns:
- the topology builder
-
-