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

COVERAGE SUMMARY FOR SOURCE FILE [AddLoadBalancerOptions.java]

nameclass, %method, %block, %line, %
AddLoadBalancerOptions.java100% (2/2)83%  (5/6)71%  (50/70)74%  (8.9/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AddLoadBalancerOptions100% (1/1)75%  (3/4)66%  (39/59)72%  (7.9/11)
setDescription (String): AddLoadBalancerOptions 0%   (0/1)0%   (0/18)0%   (0/3)
setPersistenceType (LoadBalancerPersistenceType): AddLoadBalancerOptions 100% (1/1)95%  (18/19)98%  (2.9/3)
setType (LoadBalancerType): AddLoadBalancerOptions 100% (1/1)95%  (18/19)98%  (2.9/3)
AddLoadBalancerOptions (): void 100% (1/1)100% (3/3)100% (2/2)
     
class AddLoadBalancerOptions$Builder100% (1/1)100% (2/2)100% (11/11)100% (2/2)
AddLoadBalancerOptions$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
create (LoadBalancerType, LoadBalancerPersistenceType): AddLoadBalancerOptions 100% (1/1)100% (8/8)100% (1/1)

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 org.jclouds.gogrid.domain.LoadBalancerPersistenceType;
22import org.jclouds.gogrid.domain.LoadBalancerType;
23import org.jclouds.http.options.BaseHttpRequestOptions;
24 
25import static com.google.common.base.Preconditions.checkState;
26import static org.jclouds.gogrid.reference.GoGridQueryParams.*;
27 
28/**
29 * Optional parameters for adding a load balancer.
30 *
31 * @see org.jclouds.gogrid.services.GridLoadBalancerClient#addLoadBalancer
32 * @see <a href="http://wiki.gogrid.com/wiki/index.php/API:grid.loadbalancer.add"/>
33 *
34 * @author Oleksiy Yarmula
35 */
36public class AddLoadBalancerOptions extends BaseHttpRequestOptions {
37 
38    public AddLoadBalancerOptions setDescription(String description) {
39        checkState(!queryParameters.containsKey(DESCRIPTION_KEY), "Can't have duplicate " +
40                "load balancer description");
41        queryParameters.put(DESCRIPTION_KEY, description);
42        return this;
43    }
44 
45    public AddLoadBalancerOptions setType(LoadBalancerType loadBalancerType) {
46        checkState(!queryParameters.containsKey(LOAD_BALANCER_TYPE_KEY), "Can't have duplicate " +
47                "load balancer type limitation");
48        queryParameters.put(LOAD_BALANCER_TYPE_KEY, loadBalancerType.toString());
49        return this;
50    }
51 
52    public AddLoadBalancerOptions setPersistenceType(LoadBalancerPersistenceType loadBalancerPersistenceType) {
53        checkState(!queryParameters.containsKey(LOAD_BALANCER_PERSISTENCE_TYPE_KEY), "Can't have duplicate " +
54                "load balancer type limitation");
55        queryParameters.put(LOAD_BALANCER_PERSISTENCE_TYPE_KEY, loadBalancerPersistenceType.toString());
56        return this;
57    }
58 
59    public static class Builder {
60        public AddLoadBalancerOptions create(LoadBalancerType type,
61                                             LoadBalancerPersistenceType persistenceType) {
62            return new AddLoadBalancerOptions().setType(type).setPersistenceType(persistenceType);
63        }
64    }
65}

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