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

COVERAGE SUMMARY FOR SOURCE FILE [CloneDriveOptions.java]

nameclass, %method, %block, %line, %
CloneDriveOptions.java100% (2/2)80%  (4/5)93%  (42/45)96%  (8.7/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CloneDriveOptions$Builder100% (1/1)50%  (1/2)73%  (8/11)67%  (2/3)
CloneDriveOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
size (long): CloneDriveOptions 100% (1/1)100% (8/8)100% (2/2)
     
class CloneDriveOptions100% (1/1)100% (3/3)100% (34/34)100% (7/7)
CloneDriveOptions (): void 100% (1/1)100% (6/6)100% (3/3)
getOptions (): Map 100% (1/1)100% (4/4)100% (1/1)
size (long): CloneDriveOptions 100% (1/1)100% (24/24)100% (3/3)

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.cloudsigma.options;
20 
21import static com.google.common.base.Preconditions.checkArgument;
22 
23import java.util.Map;
24 
25import com.google.common.collect.ImmutableMap;
26import com.google.common.collect.Maps;
27 
28/**
29 * Contains options supported for clone drive operations. <h2>
30 * Usage</h2> The recommended way to instantiate a CloneDriveOptions object is to statically import
31 * CloneDriveOptions.Builder.* and invoke a static creation method followed by an instance mutator
32 * (if needed):
33 * <p/>
34 * <code>
35 * import static org.jclouds.cloudsigma.options.CloneDriveOptions.Builder.*;
36 * 
37 * 
38 * Payload payload = client.cloneDrive("drive-uuid","newName", size(2*1024*1024l));
39 * <code>
40 * 
41 * @author Adrian Cole
42 * 
43 */
44public class CloneDriveOptions {
45   private final Map<String, String> options = Maps.newLinkedHashMap();
46 
47   /**
48    * adjust to new size in bytes
49    */
50   public CloneDriveOptions size(long size) {
51      checkArgument(size >= 0, "size must be >= 0");
52      options.put("size", size + "");
53      return this;
54   }
55 
56   public static class Builder {
57 
58      /**
59       * @see CloneDriveOptions#size
60       */
61      public static CloneDriveOptions size(long size) {
62         CloneDriveOptions options = new CloneDriveOptions();
63         return options.size(size);
64      }
65 
66   }
67 
68   public Map<String, String> getOptions() {
69      return ImmutableMap.copyOf(options);
70   }
71}

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