EMMA Coverage Report (generated Mon Oct 17 05:41:20 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)

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

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