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 [AddInternetServiceOptions.java]

nameclass, %method, %block, %line, %
AddInternetServiceOptions.java100% (2/2)56%  (5/9)41%  (37/90)51%  (12.8/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddInternetServiceOptions100% (1/1)60%  (3/5)34%  (22/65)47%  (9/19)
bindToRequest (HttpRequest, Map): HttpRequest 0%   (0/1)0%   (0/37)0%   (0/8)
monitorDisabled (): AddInternetServiceOptions 0%   (0/1)0%   (0/6)0%   (0/2)
AddInternetServiceOptions (): void 100% (1/1)100% (12/12)100% (5/5)
disabled (): AddInternetServiceOptions 100% (1/1)100% (5/5)100% (2/2)
withDescription (String): AddInternetServiceOptions 100% (1/1)100% (5/5)100% (2/2)
     
class AddInternetServiceOptions$Builder100% (1/1)50%  (2/4)60%  (15/25)57%  (4/7)
AddInternetServiceOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
monitorDisabled (): AddInternetServiceOptions 0%   (0/1)0%   (0/7)0%   (0/2)
disabled (): AddInternetServiceOptions 100% (1/1)100% (7/7)100% (2/2)
withDescription (String): AddInternetServiceOptions 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.BindAddInternetServiceToXmlPayload;
25 
26import com.google.common.annotations.VisibleForTesting;
27import com.google.common.collect.ImmutableMap;
28 
29/**
30 * 
31 * @author Adrian Cole
32 * 
33 */
34public class AddInternetServiceOptions extends BindAddInternetServiceToXmlPayload {
35 
36   @VisibleForTesting
37   String description = null;
38   @VisibleForTesting
39   String enabled = "true";
40   @VisibleForTesting
41   Boolean monitorEnabled = null;
42 
43   @Override
44   public <R extends HttpRequest> R bindToRequest(R request, Map<String, String> postParams) {
45      ImmutableMap.Builder<String, String> copy = ImmutableMap.<String, String> builder();
46      copy.putAll(postParams);
47      if (description != null)
48         copy.put("description", description);
49      copy.put("enabled", enabled);
50      if (monitorEnabled != null)
51         copy.put("monitor", monitorEnabled.toString());
52      return super.bindToRequest(request, copy.build());
53   }
54 
55   public AddInternetServiceOptions disabled() {
56      this.enabled = "false";
57      return this;
58   }
59 
60   public AddInternetServiceOptions monitorDisabled() {
61      this.monitorEnabled = false;
62      return this;
63   }
64 
65   public AddInternetServiceOptions withDescription(String description) {
66      this.description = description;
67      return this;
68   }
69 
70   public static class Builder {
71 
72      /**
73       * @see AddInternetServiceOptions#withDescription(String)
74       */
75      public static AddInternetServiceOptions withDescription(String description) {
76         AddInternetServiceOptions options = new AddInternetServiceOptions();
77         return options.withDescription(description);
78      }
79 
80      /**
81       * @see AddInternetServiceOptions#monitorDisabled()
82       */
83      public static AddInternetServiceOptions monitorDisabled() {
84         AddInternetServiceOptions options = new AddInternetServiceOptions();
85         return options.monitorDisabled();
86      }
87 
88      /**
89       * @see AddInternetServiceOptions#disabled()
90       */
91      public static AddInternetServiceOptions disabled() {
92         AddInternetServiceOptions options = new AddInternetServiceOptions();
93         return options.disabled();
94      }
95   }
96}

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