Class 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 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 topologyBuilder
        name - 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
      • 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