EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.cloudloadbalancers.options]

COVERAGE SUMMARY FOR SOURCE FILE [ListOptions.java]

nameclass, %method, %block, %line, %
ListOptions.java100% (2/2)86%  (6/7)92%  (68/74)95%  (13.3/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ListOptions$Builder100% (1/1)67%  (2/3)84%  (16/19)80%  (4/5)
ListOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
limit (int): ListOptions 100% (1/1)100% (8/8)100% (2/2)
marker (String): ListOptions 100% (1/1)100% (8/8)100% (2/2)
     
class ListOptions100% (1/1)100% (4/4)95%  (52/55)98%  (9.8/10)
limit (int): ListOptions 100% (1/1)94%  (29/31)96%  (3.9/4)
marker (String): ListOptions 100% (1/1)94%  (15/16)98%  (2.9/3)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
ListOptions (): void 100% (1/1)100% (3/3)100% (2/2)

1package org.jclouds.cloudloadbalancers.options;
2 
3import static com.google.common.base.Preconditions.checkArgument;
4 
5import org.jclouds.http.options.BaseHttpRequestOptions;
6 
7import com.google.common.collect.ImmutableSet;
8 
9/**
10 * To reduce load on the service, list operations will return a maximum of 100 items at a time. To
11 * navigate the collection, the limit and marker parameters (for example, ?limit=50&marker=1 ) can
12 * be set in the URI. If a marker beyond the end of a list is given, an empty list is returned. Note
13 * that list operations never return 404 (itemNotFound) faults.
14 * 
15 * @see <a
16 *      href="http://docs.rackspacecloud.com/loadbalancers/api/v1.0/clb-devguide/content/ch03s06.html"
17 *      />
18 * @author Adrian Cole
19 */
20public class ListOptions extends BaseHttpRequestOptions {
21   public static final ListOptions NONE = new ListOptions();
22 
23   /**
24    * Indicates where to begin listing, if the previous list was larger than the limit.
25    */
26   public ListOptions marker(String marker) {
27      checkArgument(marker != null, "marker cannot be null");
28      queryParameters.replaceValues("marker", ImmutableSet.of(marker));
29      return this;
30   }
31 
32   /**
33    * To reduce load on the service, list operations will return a maximum of 100 items at a time.
34    * <p/>
35    * Note that list operations never return itemNotFound (404) faults.
36    */
37   public ListOptions limit(int limit) {
38      checkArgument(limit >= 0, "limit must be >= 0");
39      checkArgument(limit <= 10000, "limit must be <= 10000");
40      queryParameters.replaceValues("limit", ImmutableSet.of(limit + ""));
41      return this;
42   }
43 
44   public static class Builder {
45 
46      /**
47       * @see ListOptions#marker(marker)
48       */
49      public static ListOptions marker(String marker) {
50         ListOptions options = new ListOptions();
51         return options.marker(marker);
52      }
53 
54      /**
55       * @see ListOptions#limit(long)
56       */
57      public static ListOptions limit(int limit) {
58         ListOptions options = new ListOptions();
59         return options.limit(limit);
60      }
61 
62   }
63}

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