예제 #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;
 }
예제 #2
0
 @Override
 public NetworkContext.Builder setAddress(String address) {
   network.address = Args.checkNotNull(address, "address cannot be null");
   return this;
 }
예제 #3
0
 @Override
 public NetworkContext.Builder setName(String name) {
   Args.checkNotNull(name, "name cannot be null");
   network.name = name;
   return this;
 }
예제 #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");
 }
예제 #5
0
 @Override
 public Builder removeComponent(ComponentContext component) {
   Args.checkNotNull(component, "component cannot be null");
   network.components.remove(component.name());
   return this;
 }
예제 #6
0
 @Override
 public Builder setConfig(NetworkConfig config) {
   Args.checkNotNull(config, "configuration cannot be null");
   network.config = config;
   return this;
 }
예제 #7
0
 @Override
 public Builder setVersion(String version) {
   Args.checkNotNull(version, "version cannot be null");
   network.version = version;
   return this;
 }