EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.deltacloud.options]

COVERAGE SUMMARY FOR SOURCE FILE [CreateInstanceOptions.java]

nameclass, %method, %block, %line, %
CreateInstanceOptions.java100% (2/2)40%  (4/10)38%  (26/69)41%  (6.5/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CreateInstanceOptions$Builder100% (1/1)25%  (1/4)30%  (8/27)29%  (2/7)
CreateInstanceOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
hardwareProfile (String): CreateInstanceOptions 0%   (0/1)0%   (0/8)0%   (0/2)
realm (String): CreateInstanceOptions 0%   (0/1)0%   (0/8)0%   (0/2)
named (String): CreateInstanceOptions 100% (1/1)100% (8/8)100% (2/2)
     
class CreateInstanceOptions100% (1/1)50%  (3/6)43%  (18/42)50%  (5/10)
getName (): String 0%   (0/1)0%   (0/4)0%   (0/1)
hardwareProfile (String): CreateInstanceOptions 0%   (0/1)0%   (0/10)0%   (0/2)
realm (String): CreateInstanceOptions 0%   (0/1)0%   (0/10)0%   (0/2)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
CreateInstanceOptions (): void 100% (1/1)100% (3/3)100% (2/2)
named (String): CreateInstanceOptions 100% (1/1)100% (10/10)100% (2/2)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.deltacloud.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import org.jclouds.http.options.BaseHttpRequestOptions;
24 
25/**
26 * Contains options supported in the Deltacloud API for the Create Instance operation. <h2>
27 * Usage</h2> The recommended way to instantiate a CreateInstanceOptions object is to statically
28 * import CreateInstanceOptions.Builder.* and invoke a static creation method followed by an
29 * instance mutator (if needed):
30 * <p/>
31 * <code>
32 * import static org.jclouds.deltacloud.options.CreateInstanceOptions.Builder.*
33 * <p/>
34 * DeltacloudClient connection = // get connection
35 * ListenableFuture<Instance> instance = client.createInstance(collection, "imageId", named("robot"));
36 * <code>
37 * 
38 * @author Adrian Cole
39 * @see <a href="http://deltacloud.org/api.html#h1" />
40 */
41public class CreateInstanceOptions extends BaseHttpRequestOptions {
42   public static final CreateInstanceOptions NONE = new CreateInstanceOptions();
43 
44   /**
45    * A short label to identify the instance.
46    * 
47    */
48   public CreateInstanceOptions named(String name) {
49      formParameters.put("name", checkNotNull(name, "name"));
50      return this;
51   }
52 
53   /**
54    * The realm in which to launch the instance
55    * 
56    */
57   public CreateInstanceOptions realm(String realmId) {
58      formParameters.put("realm_id", checkNotNull(realmId, "realmId"));
59      return this;
60   }
61 
62   /**
63    * The hardware profile upon which to launch the instance
64    */
65   public CreateInstanceOptions hardwareProfile(String hwpName) {
66      formParameters.put("hwp_name", checkNotNull(hwpName, "hwpName"));
67      return this;
68   }
69 
70   public String getName() {
71      return this.getFirstFormOrNull("name");
72   }
73 
74   public static class Builder {
75 
76      /**
77       * @see CreateInstanceOptions#named
78       */
79      public static CreateInstanceOptions named(String name) {
80         CreateInstanceOptions options = new CreateInstanceOptions();
81         return options.named(name);
82      }
83 
84      /**
85       * @see CreateInstanceOptions#realm
86       */
87      public static CreateInstanceOptions realm(String realmId) {
88         CreateInstanceOptions options = new CreateInstanceOptions();
89         return options.realm(realmId);
90      }
91 
92      /**
93       * @see CreateInstanceOptions#hardwareProfile
94       */
95      public static CreateInstanceOptions hardwareProfile(String hwpName) {
96         CreateInstanceOptions options = new CreateInstanceOptions();
97         return options.hardwareProfile(hwpName);
98      }
99 
100   }
101}

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