EMMA Coverage Report (generated Mon Oct 17 05:41:20 EDT 2011)
[all classes][org.jclouds.trmk.vcloud_0_8.options]

COVERAGE SUMMARY FOR SOURCE FILE [AddNodeOptions.java]

nameclass, %method, %block, %line, %
AddNodeOptions.java100% (2/2)71%  (5/7)58%  (34/59)69%  (11.8/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddNodeOptions100% (1/1)75%  (3/4)46%  (19/41)62%  (8/13)
bindToRequest (HttpRequest, Map): HttpRequest 0%   (0/1)0%   (0/22)0%   (0/5)
AddNodeOptions (): void 100% (1/1)100% (9/9)100% (4/4)
disabled (): AddNodeOptions 100% (1/1)100% (5/5)100% (2/2)
withDescription (String): AddNodeOptions 100% (1/1)100% (5/5)100% (2/2)
     
class AddNodeOptions$Builder100% (1/1)67%  (2/3)83%  (15/18)80%  (4/5)
AddNodeOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
disabled (): AddNodeOptions 100% (1/1)100% (7/7)100% (2/2)
withDescription (String): AddNodeOptions 100% (1/1)100% (8/8)100% (2/2)

1/**
2 * Licensed to jclouds, Inc. (jclouds) under one or more
3 * contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  jclouds licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19package org.jclouds.trmk.vcloud_0_8.options;
20 
21import java.util.Map;
22 
23import org.jclouds.http.HttpRequest;
24import org.jclouds.trmk.vcloud_0_8.binders.BindAddNodeServiceToXmlPayload;
25 
26import com.google.common.annotations.VisibleForTesting;
27import com.google.common.collect.Maps;
28 
29/**
30 * 
31 * @author Adrian Cole
32 * 
33 */
34public class AddNodeOptions extends BindAddNodeServiceToXmlPayload {
35 
36   @VisibleForTesting
37   String description = null;
38   @VisibleForTesting
39   String enabled = "true";
40   @Override
41   public <R extends HttpRequest> R bindToRequest(R request, Map<String, String> postParams) {
42      Map<String, String> copy = Maps.newHashMap();
43      copy.putAll(postParams);
44      copy.put("description", description);
45      copy.put("enabled", enabled);
46      return super.bindToRequest(request, copy);
47   }
48 
49   public AddNodeOptions disabled() {
50      this.enabled = "false";
51      return this;
52   }
53 
54   public AddNodeOptions withDescription(String description) {
55      this.description = description;
56      return this;
57   }
58 
59   public static class Builder {
60 
61      /**
62       * @see AddNodeOptions#withDescription(String)
63       */
64      public static AddNodeOptions withDescription(String description) {
65         AddNodeOptions options = new AddNodeOptions();
66         return options.withDescription(description);
67      }
68 
69      /**
70       * @see AddNodeOptions#disabled()
71       */
72      public static AddNodeOptions disabled() {
73         AddNodeOptions options = new AddNodeOptions();
74         return options.disabled();
75      }
76   }
77}

[all classes][org.jclouds.trmk.vcloud_0_8.options]
EMMA 2.0.5312 (C) Vladimir Roubtsov