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

COVERAGE SUMMARY FOR SOURCE FILE [InstantiateVAppTemplateOptions.java]

nameclass, %method, %block, %line, %
InstantiateVAppTemplateOptions.java100% (2/2)57%  (13/23)35%  (115/328)33%  (24.8/76)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class InstantiateVAppTemplateOptions100% (1/1)62%  (10/16)33%  (90/276)30%  (19/64)
block (boolean): InstantiateVAppTemplateOptions 0%   (0/1)0%   (0/5)0%   (0/2)
deploy (boolean): InstantiateVAppTemplateOptions 0%   (0/1)0%   (0/5)0%   (0/2)
equals (Object): boolean 0%   (0/1)0%   (0/90)0%   (0/29)
hashCode (): int 0%   (0/1)0%   (0/78)0%   (0/9)
powerOn (boolean): InstantiateVAppTemplateOptions 0%   (0/1)0%   (0/5)0%   (0/2)
shouldBlock (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
InstantiateVAppTemplateOptions (): void 100% (1/1)100% (18/18)100% (7/7)
addNetworkConfig (NetworkConfig): InstantiateVAppTemplateOptions 100% (1/1)100% (9/9)100% (2/2)
customizeOnInstantiate (boolean): InstantiateVAppTemplateOptions 100% (1/1)100% (6/6)100% (2/2)
description (String): InstantiateVAppTemplateOptions 100% (1/1)100% (5/5)100% (2/2)
getDescription (): String 100% (1/1)100% (3/3)100% (1/1)
getNetworkConfig (): Set 100% (1/1)100% (3/3)100% (1/1)
shouldCustomizeOnInstantiate (): Boolean 100% (1/1)100% (3/3)100% (1/1)
shouldDeploy (): boolean 100% (1/1)100% (3/3)100% (1/1)
shouldPowerOn (): boolean 100% (1/1)100% (3/3)100% (1/1)
toString (): String 100% (1/1)100% (37/37)100% (1/1)
     
class InstantiateVAppTemplateOptions$Builder100% (1/1)43%  (3/7)48%  (25/52)46%  (6/13)
InstantiateVAppTemplateOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
block (boolean): InstantiateVAppTemplateOptions 0%   (0/1)0%   (0/8)0%   (0/2)
deploy (boolean): InstantiateVAppTemplateOptions 0%   (0/1)0%   (0/8)0%   (0/2)
powerOn (boolean): InstantiateVAppTemplateOptions 0%   (0/1)0%   (0/8)0%   (0/2)
addNetworkConfig (NetworkConfig): InstantiateVAppTemplateOptions 100% (1/1)100% (8/8)100% (2/2)
customizeOnInstantiate (Boolean): InstantiateVAppTemplateOptions 100% (1/1)100% (9/9)100% (2/2)
description (String): InstantiateVAppTemplateOptions 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.vcloud.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Set;
24 
25import org.jclouds.vcloud.domain.network.NetworkConfig;
26 
27import com.google.common.collect.Sets;
28 
29/**
30 * 
31 * @author Adrian Cole
32 * 
33 */
34public class InstantiateVAppTemplateOptions {
35   private Set<NetworkConfig> networkConfig = Sets.newLinkedHashSet();
36 
37   private Boolean customizeOnInstantiate;
38   private String description = null;
39   private boolean block = true;
40   private boolean deploy = true;
41   private boolean powerOn = true;
42 
43   public String getDescription() {
44      return description;
45   }
46 
47   public boolean shouldBlock() {
48      return block;
49   }
50 
51   public boolean shouldDeploy() {
52      return deploy;
53   }
54 
55   public boolean shouldPowerOn() {
56      return powerOn;
57   }
58 
59   /**
60    * Optional description. Used for the Description of the vApp created by this
61    * instantiation.
62    */
63   public InstantiateVAppTemplateOptions description(String description) {
64      this.description = description;
65      return this;
66   }
67 
68   /**
69    * deploy the vapp after it is instantiated?
70    */
71   public InstantiateVAppTemplateOptions deploy(boolean deploy) {
72      this.deploy = deploy;
73      return this;
74   }
75 
76   /**
77    * powerOn the vapp after it is instantiated?
78    */
79   public InstantiateVAppTemplateOptions powerOn(boolean powerOn) {
80      this.powerOn = powerOn;
81      return this;
82   }
83 
84   /**
85    * block until instantiate or deployment operations complete?
86    */
87   public InstantiateVAppTemplateOptions block(boolean block) {
88      this.block = block;
89      return this;
90   }
91 
92   /**
93    * If true, then customization is executed for all children that include a
94    * GuestCustomizationSection.
95    */
96   public InstantiateVAppTemplateOptions customizeOnInstantiate(boolean customizeOnInstantiate) {
97      this.customizeOnInstantiate = customizeOnInstantiate;
98      return this;
99   }
100 
101   /**
102    * {@networkConfig VAppTemplate}s have internal networks that can be
103    * connected in order to access the internet or other external networks.
104    * 
105    * <h4>default behaviour if you don't use this option</h4> By default, we
106    * connect the first internal {@networkConfig
107    * org.jclouds.vcloud.domain.VAppTemplate#getNetworkSection network in the
108    * vapp template}to a default chosen from the org or specified via
109    * {@networkConfig
110    * org.jclouds.vcloud.reference.VCloudConstants#
111    * PROPERTY_VCLOUD_DEFAULT_NETWORK} using the {@networkConfig
112    *  org.jclouds.vcloud.domain.FenceMode#BRIDGED} or an
113    * override set by the property {@networkConfig
114    * org.jclouds.vcloud.reference.VCloudConstants#
115    * PROPERTY_VCLOUD_DEFAULT_FENCEMODE}.
116    */
117   public InstantiateVAppTemplateOptions addNetworkConfig(NetworkConfig networkConfig) {
118      this.networkConfig.add(checkNotNull(networkConfig, "networkConfig"));
119      return this;
120   }
121 
122   public Set<NetworkConfig> getNetworkConfig() {
123      return networkConfig;
124   }
125 
126   public Boolean shouldCustomizeOnInstantiate() {
127      return customizeOnInstantiate;
128   }
129 
130   public static class Builder {
131 
132      /**
133       * @see InstantiateVAppTemplateOptions#block
134       */
135      public static InstantiateVAppTemplateOptions block(boolean block) {
136         InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
137         return options.block(block);
138      }
139 
140      /**
141       * @see InstantiateVAppTemplateOptions#description
142       */
143      public static InstantiateVAppTemplateOptions description(String description) {
144         InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
145         return options.description(description);
146      }
147 
148      /**
149       * @see InstantiateVAppTemplateOptions#deploy
150       */
151      public static InstantiateVAppTemplateOptions deploy(boolean deploy) {
152         InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
153         return options.deploy(deploy);
154      }
155 
156      /**
157       * @see InstantiateVAppTemplateOptions#powerOn
158       */
159      public static InstantiateVAppTemplateOptions powerOn(boolean powerOn) {
160         InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
161         return options.powerOn(powerOn);
162      }
163 
164      /**
165       * @see InstantiateVAppTemplateOptions#customizeOnInstantiate
166       */
167      public static InstantiateVAppTemplateOptions customizeOnInstantiate(Boolean customizeOnInstantiate) {
168         InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
169         return options.customizeOnInstantiate(customizeOnInstantiate);
170      }
171 
172      /**
173       * @see InstantiateVAppTemplateOptions#addNetworkConfig
174       */
175      public static InstantiateVAppTemplateOptions addNetworkConfig(NetworkConfig networkConfig) {
176         InstantiateVAppTemplateOptions options = new InstantiateVAppTemplateOptions();
177         return options.addNetworkConfig(networkConfig);
178      }
179 
180   }
181 
182   @Override
183   public String toString() {
184      return "[networkConfig=" + networkConfig + ", customizeOnInstantiate=" + customizeOnInstantiate
185            + ", description=" + description + ", block=" + block + ", deploy=" + deploy + ", powerOn=" + powerOn + "]";
186   }
187 
188   @Override
189   public int hashCode() {
190      final int prime = 31;
191      int result = 1;
192      result = prime * result + (block ? 1231 : 1237);
193      result = prime * result + ((customizeOnInstantiate == null) ? 0 : customizeOnInstantiate.hashCode());
194      result = prime * result + (deploy ? 1231 : 1237);
195      result = prime * result + ((description == null) ? 0 : description.hashCode());
196      result = prime * result + ((networkConfig == null) ? 0 : networkConfig.hashCode());
197      result = prime * result + (powerOn ? 1231 : 1237);
198      return result;
199   }
200 
201   @Override
202   public boolean equals(Object obj) {
203      if (this == obj)
204         return true;
205      if (obj == null)
206         return false;
207      if (getClass() != obj.getClass())
208         return false;
209      InstantiateVAppTemplateOptions other = (InstantiateVAppTemplateOptions) obj;
210      if (block != other.block)
211         return false;
212      if (customizeOnInstantiate == null) {
213         if (other.customizeOnInstantiate != null)
214            return false;
215      } else if (!customizeOnInstantiate.equals(other.customizeOnInstantiate))
216         return false;
217      if (deploy != other.deploy)
218         return false;
219      if (description == null) {
220         if (other.description != null)
221            return false;
222      } else if (!description.equals(other.description))
223         return false;
224      if (networkConfig == null) {
225         if (other.networkConfig != null)
226            return false;
227      } else if (!networkConfig.equals(other.networkConfig))
228         return false;
229      if (powerOn != other.powerOn)
230         return false;
231      return true;
232   }
233 
234}

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