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

COVERAGE SUMMARY FOR SOURCE FILE [DescribeRegionsOptions.java]

nameclass, %method, %block, %line, %
DescribeRegionsOptions.java100% (2/2)60%  (3/5)77%  (24/31)81%  (6.5/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DescribeRegionsOptions$Builder100% (1/1)50%  (1/2)73%  (8/11)67%  (2/3)
DescribeRegionsOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
regions (String []): DescribeRegionsOptions 100% (1/1)100% (8/8)100% (2/2)
     
class DescribeRegionsOptions100% (1/1)67%  (2/3)80%  (16/20)83%  (5/6)
getZones (): Set 0%   (0/1)0%   (0/4)0%   (0/1)
DescribeRegionsOptions (): void 100% (1/1)100% (3/3)100% (2/2)
regions (String []): DescribeRegionsOptions 100% (1/1)100% (13/13)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.ec2.options;
20 
21import java.util.Arrays;
22import java.util.Set;
23 
24import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
25 
26/**
27 * Contains options supported in the Form API for the DescribeRegions operation. <h2>
28 * Usage</h2> The recommended way to instantiate a DescribeRegionsOptions object is to statically
29 * import DescribeRegionsOptions.Builder.* and invoke a static creation method followed by an
30 * instance mutator (if needed):
31 * <p/>
32 * <code>
33 * import static org.jclouds.ec2.options.DescribeRegionsOptions.Builder.*
34 * <p/>
35 * EC2Client connection = // get connection
36 * Future<Set<ImageMetadata>> images = connection.getRegionsAndRegionsServices().describeRegions(regions("us-east-1a", "us-east-1b"));
37 * <code>
38 * 
39 * @author Adrian Cole
40 * @see <a
41 *      href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-form-DescribeRegions.html"
42 *      />
43 */
44public class DescribeRegionsOptions extends BaseEC2RequestOptions {
45 
46   /**
47    * Name of a Region.
48    */
49   public DescribeRegionsOptions regions(String... regions) {
50      String[] regionStrings = Arrays.copyOf(regions, regions.length, String[].class);
51      indexFormValuesWithPrefix("RegionName", regionStrings);
52      return this;
53   }
54 
55   public Set<String> getZones() {
56      return getFormValuesWithKeysPrefixedBy("RegionName.");
57   }
58 
59   public static class Builder {
60 
61      /**
62       * @see DescribeRegionsOptions#regions(String[] )
63       */
64      public static DescribeRegionsOptions regions(String... regions) {
65         DescribeRegionsOptions options = new DescribeRegionsOptions();
66         return options.regions(regions);
67      }
68 
69   }
70}

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