Esempio n. 1
0
 @Override
 public Builder setComponents(Collection<ComponentContext> components) {
   Args.checkNotNull(components, "components cannot be null");
   network.components.clear();
   for (ComponentContext component : components) {
     network.components.put(component.name(), component);
   }
   return this;
 }
Esempio n. 2
0
 @Override
 public NetworkContext.Builder setAddress(String address) {
   network.address = Args.checkNotNull(address, "address cannot be null");
   return this;
 }
Esempio n. 3
0
 @Override
 public NetworkContext.Builder setName(String name) {
   Args.checkNotNull(name, "name cannot be null");
   network.name = name;
   return this;
 }
Esempio n. 4
0
 /** Checks network fields. */
 private void checkFields() {
   Args.checkNotNull(network.name, "name cannot be null");
   Args.checkNotNull(network.version, "version cannot be null");
   Args.checkNotNull(network.config, "configuration cannot be null");
   Args.checkNotNull(network.components, "components cannot be null");
 }
Esempio n. 5
0
 @Override
 public Builder removeComponent(ComponentContext component) {
   Args.checkNotNull(component, "component cannot be null");
   network.components.remove(component.name());
   return this;
 }
Esempio n. 6
0
 @Override
 public Builder setConfig(NetworkConfig config) {
   Args.checkNotNull(config, "configuration cannot be null");
   network.config = config;
   return this;
 }
Esempio n. 7
0
 @Override
 public Builder setVersion(String version) {
   Args.checkNotNull(version, "version cannot be null");
   network.version = version;
   return this;
 }