EMMA Coverage Report (generated Fri Apr 27 15:03:37 EDT 2012)
[all classes][org.jclouds.ec2.options]

COVERAGE SUMMARY FOR SOURCE FILE [DescribeImagesOptions.java]

nameclass, %method, %block, %line, %
DescribeImagesOptions.java100% (2/2)62%  (8/13)72%  (54/75)72%  (14.5/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DescribeImagesOptions100% (1/1)56%  (5/9)62%  (30/48)64%  (9/14)
getExecutableBy (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getImageIds (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
getOwners (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
imageIds (Iterable): DescribeImagesOptions 0%   (0/1)0%   (0/6)0%   (0/2)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
DescribeImagesOptions (): void 100% (1/1)100% (3/3)100% (2/2)
executableBy (String): DescribeImagesOptions 100% (1/1)100% (10/10)100% (2/2)
imageIds (String []): DescribeImagesOptions 100% (1/1)100% (6/6)100% (2/2)
ownedBy (String []): DescribeImagesOptions 100% (1/1)100% (6/6)100% (2/2)
     
class DescribeImagesOptions$Builder100% (1/1)75%  (3/4)89%  (24/27)86%  (6/7)
DescribeImagesOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
executableBy (String): DescribeImagesOptions 100% (1/1)100% (8/8)100% (2/2)
imageIds (String []): DescribeImagesOptions 100% (1/1)100% (8/8)100% (2/2)
ownedBy (String []): DescribeImagesOptions 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.ec2.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Set;
24 
25import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
26 
27/**
28 * Contains options supported in the Form API for the DescribeImages operation. <h2>
29 * Usage</h2> The recommended way to instantiate a DescribeImagesOptions object is to statically
30 * import DescribeImagesOptions.Builder.* and invoke a static creation method followed by an
31 * instance mutator (if needed):
32 * <p/>
33 * <code>
34 * import static org.jclouds.ec2.options.DescribeImagesOptions.Builder.*
35 * <p/>
36 * EC2Client connection = // get connection
37 * Future<Set<ImageMetadata>> images = connection.getAMIServices().describeImages(executableBy("123125").imageIds(1000, 1004));
38 * <code>
39 * 
40 * @author Adrian Cole
41 * @see <a
42 *      href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-form-DescribeImages.html"
43 *      />
44 */
45public class DescribeImagesOptions extends BaseEC2RequestOptions {
46   public static final DescribeImagesOptions NONE = new DescribeImagesOptions();
47 
48   /**
49    * AMIs for which the specified user has explicit launch permissions.
50    * 
51    */
52   public DescribeImagesOptions executableBy(String identityId) {
53      formParameters.put("ExecutableBy", checkNotNull(identityId, "identityId"));
54      return this;
55   }
56 
57   public String getExecutableBy() {
58      return getFirstFormOrNull("ExecutableBy");
59   }
60 
61   /**
62    * AMI IDs to describe.
63    */
64   public DescribeImagesOptions imageIds(String... imageIds) {
65      indexFormValuesWithPrefix("ImageId", imageIds);
66      return this;
67   }
68 
69   public DescribeImagesOptions imageIds(Iterable<String> imageIds) {
70      indexFormValuesWithPrefix("ImageId", imageIds);
71      return this;
72   }
73 
74   public Set<String> getImageIds() {
75      return getFormValuesWithKeysPrefixedBy("ImageId.");
76   }
77 
78   /**
79    * Returns AMIs owned by the specified owner. Multiple owners can be specified.
80    */
81   public DescribeImagesOptions ownedBy(String... owners) {
82      indexFormValuesWithPrefix("Owner", owners);
83      return this;
84   }
85 
86   public Set<String> getOwners() {
87      return getFormValuesWithKeysPrefixedBy("Owner.");
88   }
89 
90   public static class Builder {
91 
92      /**
93       * @see DescribeImagesOptions#executableBy(String )
94       */
95      public static DescribeImagesOptions executableBy(String identityId) {
96         DescribeImagesOptions options = new DescribeImagesOptions();
97         return options.executableBy(identityId);
98      }
99 
100      /**
101       * @see DescribeImagesOptions#imageIds(String[] )
102       */
103      public static DescribeImagesOptions imageIds(String... imageIds) {
104         DescribeImagesOptions options = new DescribeImagesOptions();
105         return options.imageIds(imageIds);
106      }
107 
108      /**
109       * @see DescribeImagesOptions#ownedBy(String[] )
110       */
111      public static DescribeImagesOptions ownedBy(String... owners) {
112         DescribeImagesOptions options = new DescribeImagesOptions();
113         return options.ownedBy(owners);
114      }
115 
116   }
117}

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