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

COVERAGE SUMMARY FOR SOURCE FILE [Status.java]

nameclass, %method, %block, %line, %
Status.java100% (2/2)88%  (7/8)83%  (142/171)61%  (14.5/24)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Status100% (1/1)86%  (6/7)82%  (107/131)61%  (14.6/24)
valueOf (String): Status 0%   (0/1)0%   (0/5)0%   (0/1)
value (): String 100% (1/1)41%  (7/17)29%  (2/7)
fromValue (int): Status 100% (1/1)62%  (10/16)62%  (5/8)
fromValue (String): Status 100% (1/1)70%  (7/10)33%  (1/3)
<static initializer> 100% (1/1)100% (74/74)100% (6/6)
Status (String, int): void 100% (1/1)100% (5/5)100% (2/2)
values (): Status [] 100% (1/1)100% (4/4)100% (1/1)
     
class Status$1100% (1/1)100% (1/1)88%  (35/40)87%  (0.9/1)
<static initializer> 100% (1/1)88%  (35/40)87%  (0.9/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.trmk.vcloud_0_8.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23/**
24 * Objects such as vAppTemplate, vApp, and Vm have a status attribute whose
25 * value indicates the state of the object. Status for an object, such as a
26 * vAppTemplate or vApp, whose Children (Vm objects) each have a status of their
27 * own, is computed from the status of the Children.
28 * 
29 * <h2>NOTE</h2>
30 * <p/>
31 * The deployment status of an object is indicated by the value of its deployed
32 * attribute.
33 * 
34 * @since vcloud api 0.8
35 * 
36 * @author Adrian Cole
37 */
38public enum Status {
39 
40   /**
41    * The {@link VAppTemplate}, {@link VApp}, or {@link Vm} is unresolved.
42    * 
43    * @since vcloud api 0.8
44    */
45   UNRESOLVED,
46   /**
47    * The {@link VAppTemplate}, {@link VApp}, or {@link Vm} is resolved.
48    * 
49    * @since vcloud api 0.8
50    */
51   RESOLVED,
52 
53   /**
54    * The {@link VApp} or {@link Vm} is suspended.
55    * 
56    * @since vcloud api 0.8
57    */
58   SUSPENDED,
59   /**
60    * The {@link VApp} or {@link Vm} is powered on
61    * 
62    * @since vcloud api 0.8
63    */
64   ON,
65   /**
66    * The {@link VAppTemplate}, {@link VApp}, or {@link Vm} is off.
67    * 
68    * @since vcloud api 0.8
69    */
70   OFF, UNRECOGNIZED, DEPLOYED;
71   public String value() {
72      switch (this) {
73      case UNRESOLVED:
74         return "0";
75      case RESOLVED:
76         return "1";
77      case OFF:
78         return "2";
79      case SUSPENDED:
80         return "3";
81      case ON:
82         return "4";
83      default:
84         return "7";
85      }
86   }
87 
88   public static Status fromValue(String status) {
89      try {
90         return fromValue(Integer.parseInt(checkNotNull(status, "status")));
91      } catch (IllegalArgumentException e) {
92         return UNRECOGNIZED;
93      }
94   }
95 
96   public static Status fromValue(int v) {
97      switch (v) {
98      case 0:
99         return UNRESOLVED;
100      case 1:
101         return RESOLVED;
102      case 2:
103         return OFF;
104      case 3:
105         return SUSPENDED;
106      case 4:
107         return ON;
108      case 7:
109         return UNRECOGNIZED;
110      default:
111         return UNRECOGNIZED;
112      }
113   }
114 
115}

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