EMMA Coverage Report (generated Wed Aug 10 12:30:04 EDT 2011)
[all classes][org.jclouds.vcloud.domain]

COVERAGE SUMMARY FOR SOURCE FILE [AllocationModel.java]

nameclass, %method, %block, %line, %
AllocationModel.java50%  (1/2)62%  (5/8)60%  (67/112)48%  (6.7/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AllocationModel$10%   (0/1)0%   (0/1)0%   (0/26)0%   (0/1)
<static initializer> 0%   (0/1)0%   (0/26)0%   (0/1)
     
class AllocationModel100% (1/1)71%  (5/7)78%  (67/86)48%  (6.7/14)
toString (): String 0%   (0/1)0%   (0/3)0%   (0/1)
value (): String 0%   (0/1)0%   (0/13)0%   (0/5)
fromValue (String): AllocationModel 100% (1/1)75%  (9/12)33%  (1/3)
<static initializer> 100% (1/1)100% (44/44)100% (5/5)
AllocationModel (String, int): void 100% (1/1)100% (5/5)100% (2/2)
valueOf (String): AllocationModel 100% (1/1)100% (5/5)100% (1/1)
values (): AllocationModel [] 100% (1/1)100% (4/4)100% (1/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.vcloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import com.google.common.base.CaseFormat;
24 
25/**
26 * The AllocationModel element defines how resources are allocated in a vDC.
27 */
28public enum AllocationModel {
29   /**
30    * Resources are committed to a vDC only when vApps are created in it
31    */
32   ALLOCATION_VAPP,
33   /**
34    * Only a percentage of the resources you allocate are committed to the organization vDC.
35    */
36   ALLOCATION_POOL,
37   /**
38    * All the resources you allocate are committed as a pool to the organization vDC. vApps in vDCs
39    * that support this allocation model can specify values for resource and limit.
40    */
41   RESERVATION_POOL,
42   /**
43    * The VCloud API returned a model unsupported in the version 1.0 spec.
44    */
45   UNRECOGNIZED;
46 
47   public String value() {
48      switch (this) {
49         case ALLOCATION_VAPP:
50            return "AllocationVApp";
51         case ALLOCATION_POOL:
52            return "AllocationPool";
53         case RESERVATION_POOL:
54            return "ReservationPool";
55         default:
56            return "UnrecognizedModel";
57      }
58   }
59 
60   @Override
61   public String toString() {
62      return value();
63   }
64 
65   public static AllocationModel fromValue(String model) {
66      try {
67         return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(model, "model")));
68      } catch (IllegalArgumentException e) {
69         return UNRECOGNIZED;
70      }
71   }
72}

[all classes][org.jclouds.vcloud.domain]
EMMA 2.0.5312 (C) Vladimir Roubtsov