jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Thompson <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs-aws] Health check and Subnet API (#70)
Date Wed, 25 Jan 2017 13:34:09 GMT
justinThompson commented on this pull request.



> +import com.google.common.collect.ImmutableMultimap.Builder;
+
+/**
+ * Binds the Iterable<String> to form parameters named with Subnets.member.index
+ */
+@Singleton
+public class BindSubnetIdsToIndexedFormParams implements Binder {
+   
+   @SuppressWarnings("unchecked")
+   @Override
+   public <R extends HttpRequest> R bindToRequest(R request, Object input) {
+      Iterable<?> values = Iterable.class.cast(checkNotNull(input, "subnetIds"));
+      Builder<String, String> builder = ImmutableMultimap.builder();
+      int i = 0;
+      for (Object o : values) {
+         builder.put("Subnets.member." + (i++ + 1), o.toString());

yep I agree, updated

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/70
Mime
View raw message