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

COVERAGE SUMMARY FOR SOURCE FILE [DescribeSpotPriceHistoryOptions.java]

nameclass, %method, %block, %line, %
DescribeSpotPriceHistoryOptions.java100% (2/2)91%  (10/11)97%  (90/93)98%  (19.5/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DescribeSpotPriceHistoryOptions$Builder100% (1/1)80%  (4/5)91%  (32/35)89%  (8/9)
DescribeSpotPriceHistoryOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
from (Date): DescribeSpotPriceHistoryOptions 100% (1/1)100% (8/8)100% (2/2)
instanceType (String): DescribeSpotPriceHistoryOptions 100% (1/1)100% (8/8)100% (2/2)
productDescription (String): DescribeSpotPriceHistoryOptions 100% (1/1)100% (8/8)100% (2/2)
to (Date): DescribeSpotPriceHistoryOptions 100% (1/1)100% (8/8)100% (2/2)
     
class DescribeSpotPriceHistoryOptions100% (1/1)100% (6/6)100% (58/58)100% (12/12)
<static initializer> 100% (1/1)100% (9/9)100% (2/2)
DescribeSpotPriceHistoryOptions (): void 100% (1/1)100% (3/3)100% (2/2)
from (Date): DescribeSpotPriceHistoryOptions 100% (1/1)100% (13/13)100% (2/2)
instanceType (String): DescribeSpotPriceHistoryOptions 100% (1/1)100% (10/10)100% (2/2)
productDescription (String): DescribeSpotPriceHistoryOptions 100% (1/1)100% (10/10)100% (2/2)
to (Date): DescribeSpotPriceHistoryOptions 100% (1/1)100% (13/13)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.aws.ec2.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import java.util.Date;
24 
25import org.jclouds.date.DateService;
26import org.jclouds.date.internal.SimpleDateFormatDateService;
27import org.jclouds.ec2.domain.InstanceType;
28import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
29 
30/**
31 * Contains options supported in the Form API for the DescribeSpotPriceHistory operation. <h2>
32 * Usage</h2> The recommended way to instantiate a DescribeSpotPriceHistoryOptions object is to
33 * statically import DescribeSpotPriceHistoryOptions.Builder.* and invoke a static creation method
34 * followed by an instance mutator (if needed):
35 * <p/>
36 * <code>
37 * import static org.jclouds.aws.ec2.options.DescribeSpotPriceHistoryOptions.Builder.*
38 * <p/>
39 * AWSEC2Client client = // get connection
40 * history = client.getSpotInstanceServices().describeSpotPriceHistoryInRegion(from(yesterday).instanceType("m1.small"));
41 * <code>
42 * 
43 * @author Adrian Cole
44 * @see <a href=
45 *      "http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-form-DescribeSpotPriceHistory.html"
46 *      />
47 */
48public class DescribeSpotPriceHistoryOptions extends BaseEC2RequestOptions {
49   public static final DescribeSpotPriceHistoryOptions NONE = new DescribeSpotPriceHistoryOptions();
50   private static final DateService service = new SimpleDateFormatDateService();
51 
52   /**
53    * Start date and time of the Spot Instance price history data.
54    */
55   public DescribeSpotPriceHistoryOptions from(Date start) {
56      formParameters.put("StartTime", service.iso8601DateFormat(checkNotNull(start, "start")));
57      return this;
58   }
59 
60   /**
61    * End date and time of the Spot Instance price history data.
62    */
63   public DescribeSpotPriceHistoryOptions to(Date end) {
64      formParameters.put("EndTime", service.iso8601DateFormat(checkNotNull(end, "end")));
65      return this;
66   }
67 
68   /**
69    * Specifies the instance type to return.
70    */
71   public DescribeSpotPriceHistoryOptions instanceType(String type) {
72      formParameters.put("InstanceType.1", checkNotNull(type, "type"));
73      return this;
74   }
75 
76   /**
77    * The description of the AMI.
78    */
79   public DescribeSpotPriceHistoryOptions productDescription(String description) {
80      formParameters.put("ProductDescription", checkNotNull(description, "description"));
81      return this;
82   }
83 
84   public static class Builder {
85      /**
86       * @see DescribeSpotPriceHistoryOptions#from
87       */
88      public static DescribeSpotPriceHistoryOptions from(Date start) {
89         DescribeSpotPriceHistoryOptions options = new DescribeSpotPriceHistoryOptions();
90         return options.from(start);
91      }
92 
93      /**
94       * @see DescribeSpotPriceHistoryOptions#to
95       */
96      public static DescribeSpotPriceHistoryOptions to(Date end) {
97         DescribeSpotPriceHistoryOptions options = new DescribeSpotPriceHistoryOptions();
98         return options.to(end);
99      }
100 
101      /**
102       * @see DescribeSpotPriceHistoryOptions#instanceType(InstanceType)
103       */
104      public static DescribeSpotPriceHistoryOptions instanceType(String instanceType) {
105         DescribeSpotPriceHistoryOptions options = new DescribeSpotPriceHistoryOptions();
106         return options.instanceType(instanceType);
107      }
108 
109      /**
110       * @see DescribeSpotPriceHistoryOptions#productDescription(String)
111       */
112      public static DescribeSpotPriceHistoryOptions productDescription(String description) {
113         DescribeSpotPriceHistoryOptions options = new DescribeSpotPriceHistoryOptions();
114         return options.productDescription(description);
115      }
116 
117   }
118}

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