EMMA Coverage Report (generated Mon Oct 17 05:41:20 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)53%  (57/107)63%  (13.9/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ParameterizedHardwareProperty100% (1/1)60%  (3/5)53%  (57/107)63%  (13.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)67%  (26/39)54%  (7/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 * 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.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