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

COVERAGE SUMMARY FOR SOURCE FILE [GetServerListOptions.java]

nameclass, %method, %block, %line, %
GetServerListOptions.java100% (2/2)45%  (5/11)30%  (37/125)33%  (8.9/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class GetServerListOptions$Builder100% (1/1)40%  (2/5)27%  (12/45)31%  (4/13)
excludeSandboxServers (): GetServerListOptions 0%   (0/1)0%   (0/9)0%   (0/3)
inDatacenter (String): GetServerListOptions 0%   (0/1)0%   (0/12)0%   (0/3)
limitServerTypeTo (String): GetServerListOptions 0%   (0/1)0%   (0/12)0%   (0/3)
GetServerListOptions$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
onlySandboxServers (): GetServerListOptions 100% (1/1)100% (9/9)100% (3/3)
     
class GetServerListOptions100% (1/1)50%  (3/6)31%  (25/80)40%  (5.9/15)
excludeSandboxServers (): GetServerListOptions 0%   (0/1)0%   (0/18)0%   (0/3)
inDatacenter (String): GetServerListOptions 0%   (0/1)0%   (0/18)0%   (0/3)
limitServerTypeTo (String): GetServerListOptions 0%   (0/1)0%   (0/18)0%   (0/3)
onlySandboxServers (): GetServerListOptions 100% (1/1)94%  (17/18)98%  (2.9/3)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
GetServerListOptions (): 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.gogrid.options;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22import static com.google.common.base.Preconditions.checkState;
23import static org.jclouds.gogrid.reference.GoGridQueryParams.DATACENTER_KEY;
24import static org.jclouds.gogrid.reference.GoGridQueryParams.IS_SANDBOX_KEY;
25import static org.jclouds.gogrid.reference.GoGridQueryParams.SERVER_TYPE_KEY;
26 
27import org.jclouds.http.options.BaseHttpRequestOptions;
28 
29/**
30 * @author Oleksiy Yarmula
31 */
32public class GetServerListOptions extends BaseHttpRequestOptions {
33 
34   public final static GetServerListOptions NONE = new GetServerListOptions();
35 
36   public GetServerListOptions limitServerTypeTo(String serverType) {
37      checkState(!queryParameters.containsKey(SERVER_TYPE_KEY),
38               "Can't have duplicate server type limit");
39      queryParameters.put(SERVER_TYPE_KEY, serverType);
40      return this;
41   }
42 
43   public GetServerListOptions inDatacenter(String datacenterId) {
44      checkState(!queryParameters.containsKey(DATACENTER_KEY), "Can't have duplicate datacenter id");
45      queryParameters.put(DATACENTER_KEY, datacenterId);
46      return this;
47   }
48 
49   public GetServerListOptions onlySandboxServers() {
50      checkState(!queryParameters.containsKey(IS_SANDBOX_KEY),
51               "Can't have duplicate sandbox type limit");
52      queryParameters.put(IS_SANDBOX_KEY, "true");
53      return this;
54   }
55 
56   public GetServerListOptions excludeSandboxServers() {
57      checkState(!queryParameters.containsKey(IS_SANDBOX_KEY),
58               "Can't have duplicate sandbox type limit");
59      queryParameters.put(IS_SANDBOX_KEY, "false");
60      return this;
61   }
62 
63   public static class Builder {
64      public GetServerListOptions inDatacenter(String datacenterId) {
65         GetServerListOptions getServerListOptions = new GetServerListOptions();
66         getServerListOptions.inDatacenter(checkNotNull(datacenterId));
67         return getServerListOptions;
68      }
69 
70      public GetServerListOptions limitServerTypeTo(String serverType) {
71         GetServerListOptions getServerListOptions = new GetServerListOptions();
72         getServerListOptions.limitServerTypeTo(checkNotNull(serverType));
73         return getServerListOptions;
74      }
75 
76      public GetServerListOptions onlySandboxServers() {
77         GetServerListOptions getServerListOptions = new GetServerListOptions();
78         getServerListOptions.onlySandboxServers();
79         return getServerListOptions;
80      }
81 
82      public GetServerListOptions excludeSandboxServers() {
83         GetServerListOptions getServerListOptions = new GetServerListOptions();
84         getServerListOptions.excludeSandboxServers();
85         return getServerListOptions;
86      }
87 
88   }
89 
90}

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