Class NetworkMeshBuilder

java.lang.Object
com.tnsai.coordination.groups.network.NetworkMeshBuilder

public final class NetworkMeshBuilder extends Object
Builder for creating NetworkMesh instances.

Usage Example


 NetworkMesh mesh = NetworkMesh.builder()
     .name("Agent Network")
     .topology(Topology.FULL_MESH)
     .add(agent1, agent2, agent3)
     .autoStart(true)
     .build();
 
  • Method Details

    • id

      public NetworkMeshBuilder id(String id)
      Sets the mesh ID.
      Parameters:
      id - mesh ID
      Returns:
      this builder
    • name

      public NetworkMeshBuilder name(String name)
      Sets the mesh name.
      Parameters:
      name - mesh name
      Returns:
      this builder
    • description

      public NetworkMeshBuilder description(String description)
      Sets the mesh description.
      Parameters:
      description - mesh description
      Returns:
      this builder
    • topology

      public NetworkMeshBuilder topology(Topology topology)
      Sets the network topology.
      Parameters:
      topology - topology type
      Returns:
      this builder
    • policy

      public NetworkMeshBuilder policy(com.tnsai.agents.groups.GroupPolicy policy)
      Sets the group policy.
      Parameters:
      policy - policy
      Returns:
      this builder
    • add

      public NetworkMeshBuilder add(com.tnsai.agents.Agent agent)
      Adds a member to the mesh.
      Parameters:
      agent - agent to add
      Returns:
      this builder
    • add

      public NetworkMeshBuilder add(com.tnsai.agents.Agent... agents)
      Adds multiple members to the mesh.
      Parameters:
      agents - agents to add
      Returns:
      this builder
    • autoStart

      public NetworkMeshBuilder autoStart(boolean autoStart)
      Sets whether to auto-start after build.
      Parameters:
      autoStart - auto-start flag
      Returns:
      this builder
    • build

      public NetworkMesh build()
      Builds the NetworkMesh.
      Returns:
      new NetworkMesh instance