Exemplo n.º 1
0
 public Connection data(Map<String, String> data) {
   Validate.notNull(data, "Data map must not be null");
   for (Map.Entry<String, String> entry : data.entrySet()) {
     req.data(KeyVal.create(entry.getKey(), entry.getValue()));
   }
   return this;
 }
Exemplo n.º 2
0
 public Connection data(String... keyvals) {
   Validate.notNull(keyvals, "Data key value pairs must not be null");
   Validate.isTrue(keyvals.length % 2 == 0, "Must supply an even number of key value pairs");
   for (int i = 0; i < keyvals.length; i += 2) {
     String key = keyvals[i];
     String value = keyvals[i + 1];
     Validate.notEmpty(key, "Data key must not be empty");
     Validate.notNull(value, "Data value must not be null");
     req.data(KeyVal.create(key, value));
   }
   return this;
 }
Exemplo n.º 3
0
 public Connection data(String key, String value) {
   req.data(KeyVal.create(key, value));
   return this;
 }