EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.deltacloud.domain]

COVERAGE SUMMARY FOR SOURCE FILE [ParameterizedHardwareProperty.java]

nameclass, %method, %block, %line, %
ParameterizedHardwareProperty.java100% (1/1)60%  (3/5)55%  (59/107)68%  (14.9/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ParameterizedHardwareProperty100% (1/1)60%  (3/5)55%  (59/107)68%  (14.9/22)
getParam (): HardwareParameter 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/32)0%   (0/1)
equals (Object): boolean 100% (1/1)72%  (28/39)62%  (8/13)
hashCode (): int 100% (1/1)90%  (18/20)98%  (3.9/4)
ParameterizedHardwareProperty (HardwareProperty$Kind, String, String, Object,... 100% (1/1)100% (13/13)100% (3/3)

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.deltacloud.domain;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23import org.jclouds.deltacloud.domain.internal.BaseHardwareProperty;
24 
25/**
26 * 
27 * @author Adrian Cole
28 */
29public class ParameterizedHardwareProperty extends BaseHardwareProperty {
30 
31   private final HardwareParameter param;
32 
33   public ParameterizedHardwareProperty(Kind kind, String name, String unit, Object value, HardwareParameter param) {
34      super(kind, name, unit, value);
35      this.param = checkNotNull(param, "param");
36   }
37 
38   /**
39    * 
40    * @return how to associate a non-default value with a request against an instance.
41    */
42   public HardwareParameter getParam() {
43      return param;
44   }
45 
46   @Override
47   public int hashCode() {
48      final int prime = 31;
49      int result = super.hashCode();
50      result = prime * result + ((param == null) ? 0 : param.hashCode());
51      return result;
52   }
53 
54   @Override
55   public boolean equals(Object obj) {
56      if (this == obj)
57         return true;
58      if (!super.equals(obj))
59         return false;
60      if (getClass() != obj.getClass())
61         return false;
62      ParameterizedHardwareProperty other = (ParameterizedHardwareProperty) obj;
63      if (param == null) {
64         if (other.param != null)
65            return false;
66      } else if (!param.equals(other.param))
67         return false;
68      return true;
69   }
70 
71   @Override
72   public String toString() {
73      return "[kind=" + getKind() + ", name=" + getName() + ", unit=" + getUnit() + ", value=" + getValue()
74            + ", param=" + getParam() + "]";
75   }
76}

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