All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hyperfoil.hotrod.config.HotRodClusterBuilder Maven / Gradle / Ivy

There is a newer version: 0.26
Show newest version
package io.hyperfoil.hotrod.config;

import java.util.ArrayList;
import java.util.List;

import io.hyperfoil.api.config.Rewritable;

public class HotRodClusterBuilder implements Rewritable {
   private String uri;
   private List caches = new ArrayList<>();

   @Override
   public void readFrom(HotRodClusterBuilder other) {
      this.uri = other.uri;
      this.caches = new ArrayList<>(other.caches);
   }

   public HotRodClusterBuilder uri(String uri) {
      this.uri = uri;
      return this;
   }

   public HotRodClusterBuilder addCache(String cache) {
      this.caches.add(cache);
      return this;
   }

   public HotRodCluster build() {
      return new HotRodCluster(uri, caches.toArray(String[]::new));
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy