@Test public void testVirtualGuestWithOperatingSystem() { HttpRequest request = HttpRequest.builder().method("POST").endpoint("https: TagToJson binder = new TagToJson(json); Set<String> tags = ImmutableSet.of("jclouds"); request = binder.bindToRequest(request, tags); assertEquals(request.getPayload().getRawContent(), "{\"parameters\":[\"jclouds\"]}"); }
@Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof Set); Set<String> tags = Set.class.cast(checkNotNull(input, "input")); request.setPayload(buildJson(tags)); return request; }
TagToJson implements Binder { @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof Set); Set<String> tags = Set.class.cast(checkNotNull(input, "input")); request.setPayload(buildJson(tags)); return request; } }
TagToJson implements Binder { @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof Set); Set<String> tags = Set.class.cast(checkNotNull(input, "input")); request.setPayload(buildJson(tags)); return request; } @Inject  TagToJson(Json json); }
TagToJson implements Binder { @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof Set); Set<String> tags = Set.class.cast(checkNotNull(input, "input")); request.setPayload(buildJson(tags)); return request; } @Inject  TagToJson(Json json); @Override R bindToRequest(R request, Object input); }
TagToJson implements Binder { @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(input instanceof Set); Set<String> tags = Set.class.cast(checkNotNull(input, "input")); request.setPayload(buildJson(tags)); return request; } @Inject  TagToJson(Json json); @Override R bindToRequest(R request, Object input);  }