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 [Capacity.java]

nameclass, %method, %block, %line, %
Capacity.java0%   (0/1)0%   (0/9)0%   (0/198)0%   (0/42)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Capacity0%   (0/1)0%   (0/9)0%   (0/198)0%   (0/42)
Capacity (String, long, long, int, long): void 0%   (0/1)0%   (0/18)0%   (0/7)
equals (Object): boolean 0%   (0/1)0%   (0/68)0%   (0/21)
getAllocated (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getLimit (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getOverhead (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getUnits (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getUsed (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/65)0%   (0/8)
toString (): String 0%   (0/1)0%   (0/32)0%   (0/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 
21/**
22 * reports storage resource consumption in a vDC.
23 * 
24 * @author Adrian Cole
25 */
26public class Capacity {
27 
28   private final String units;
29   private final long allocated;
30   private final long limit;
31   private final int used;
32   private final long overhead;
33 
34   public Capacity(String units, long allocated, long limit, int used, long overhead) {
35      this.units = units;
36      this.limit = limit;
37      this.allocated = allocated;
38      this.used = used;
39      this.overhead = overhead;
40   }
41 
42   public String getUnits() {
43      return units;
44   }
45 
46   public long getAllocated() {
47      return allocated;
48   }
49 
50   public long getLimit() {
51      return limit;
52   }
53 
54   /**
55    * percentage of the allocation in use.
56    */
57   public int getUsed() {
58      return used;
59   }
60 
61   /**
62    * number of Units allocated to vShield Manager virtual machines provisioned from this vDC.
63    */
64   public long getOverhead() {
65      return overhead;
66   }
67 
68   @Override
69   public int hashCode() {
70      final int prime = 31;
71      int result = 1;
72      result = prime * result + (int) (allocated ^ (allocated >>> 32));
73      result = prime * result + (int) (limit ^ (limit >>> 32));
74      result = prime * result + (int) (overhead ^ (overhead >>> 32));
75      result = prime * result + ((units == null) ? 0 : units.hashCode());
76      result = prime * result + used;
77      return result;
78   }
79 
80   @Override
81   public boolean equals(Object obj) {
82      if (this == obj)
83         return true;
84      if (obj == null)
85         return false;
86      if (getClass() != obj.getClass())
87         return false;
88      Capacity other = (Capacity) obj;
89      if (allocated != other.allocated)
90         return false;
91      if (limit != other.limit)
92         return false;
93      if (overhead != other.overhead)
94         return false;
95      if (units == null) {
96         if (other.units != null)
97            return false;
98      } else if (!units.equals(other.units))
99         return false;
100      if (used != other.used)
101         return false;
102      return true;
103   }
104 
105   @Override
106   public String toString() {
107      return "[allocated=" + allocated + ", limit=" + limit + ", overhead=" + overhead + ", units=" + units + ", used="
108               + used + "]";
109   }
110}

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