EMMA Coverage Report (generated Wed Oct 26 13:47:17 EDT 2011)
[all classes][org.jclouds.cim]

COVERAGE SUMMARY FOR SOURCE FILE [SettingData.java]

nameclass, %method, %block, %line, %
SettingData.java100% (2/2)46%  (6/13)56%  (97/172)58%  (23.8/41)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SettingData100% (1/1)33%  (3/9)54%  (78/145)54%  (18.8/35)
builder (): SettingData$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
compareTo (SettingData): int 0%   (0/1)0%   (0/16)0%   (0/3)
getElementName (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getInstanceID (): String 0%   (0/1)0%   (0/3)0%   (0/1)
toBuilder (): SettingData$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/15)0%   (0/1)
equals (Object): boolean 100% (1/1)66%  (35/53)56%  (10/18)
hashCode (): int 100% (1/1)88%  (28/32)96%  (4.8/5)
SettingData (String, String): void 100% (1/1)100% (15/15)100% (4/4)
     
class SettingData$Builder100% (1/1)75%  (3/4)70%  (19/27)83%  (5/6)
fromSettingData (SettingData): SettingData$Builder 0%   (0/1)0%   (0/8)0%   (0/1)
SettingData$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
elementName (String): SettingData$Builder 100% (1/1)100% (8/8)100% (2/2)
instanceID (String): SettingData$Builder 100% (1/1)100% (8/8)100% (2/2)

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.cim;
20 
21import static com.google.common.base.Preconditions.checkNotNull;
22 
23/**
24 * 
25 * The type of resource this allocation setting represents.
26 * 
27 * @author Adrian Cole
28 * @see <a
29 *      href="http://dmtf.org/sites/default/files/cim/cim_schema_v2280/cim_schema_2.28.0Final-Doc.zip"
30 *      />
31 * 
32 */
33public abstract class SettingData implements Comparable<SettingData> {
34 
35   public static Builder builder() {
36      return new Builder();
37   }
38 
39   public Builder toBuilder() {
40      return builder().fromSettingData(this);
41   }
42 
43   public static class Builder {
44      protected String elementName;
45      protected String instanceID;
46 
47      /**
48       * @see SettingData#getElementName
49       */
50      public Builder elementName(String elementName) {
51         this.elementName = checkNotNull(elementName, "elementName");
52         return this;
53      }
54 
55      /**
56       * @see SettingData#getInstanceID
57       */
58      public Builder instanceID(String instanceID) {
59         this.instanceID = checkNotNull(instanceID, "instanceID");
60         return this;
61      }
62 
63      public Builder fromSettingData(SettingData in) {
64         return elementName(in.getElementName()).instanceID(in.getInstanceID());
65      }
66   }
67 
68   protected final String elementName;
69   protected final String instanceID;
70 
71   public SettingData(String elementName, String instanceID) {
72      this.elementName = checkNotNull(elementName, "elementName");
73      this.instanceID = checkNotNull(instanceID, "instanceID");
74   }
75 
76   /**
77    * The user-friendly name for this instance of SettingData. In addition, the user-friendly name
78    * can be used as an index property for a search or query. (Note: The name does not have to be
79    * unique within a namespace.)
80    */
81   public String getElementName() {
82      return elementName;
83   }
84 
85   /**
86    * Within the scope of the instantiating Namespace, InstanceID opaquely and uniquely identifies
87    * an instance of this class.
88    */
89   public String getInstanceID() {
90      return instanceID;
91   }
92 
93   @Override
94   public int hashCode() {
95      final int prime = 31;
96      int result = 1;
97      result = prime * result + ((elementName == null) ? 0 : elementName.hashCode());
98      result = prime * result + ((instanceID == null) ? 0 : instanceID.hashCode());
99      return result;
100   }
101 
102   @Override
103   public boolean equals(Object obj) {
104      if (this == obj)
105         return true;
106      if (obj == null)
107         return false;
108      if (getClass() != obj.getClass())
109         return false;
110      SettingData other = (SettingData) obj;
111      if (elementName == null) {
112         if (other.elementName != null)
113            return false;
114      } else if (!elementName.equals(other.elementName))
115         return false;
116      if (instanceID == null) {
117         if (other.instanceID != null)
118            return false;
119      } else if (!instanceID.equals(other.instanceID))
120         return false;
121      return true;
122   }
123 
124   @Override
125   public String toString() {
126      return String.format("[elementName=%s, instanceID=%s]", elementName, instanceID);
127   }
128 
129   /**
130    * {@inheritDoc}
131    */
132   @Override
133   public int compareTo(SettingData o) {
134      if (instanceID == null)
135         return -1;
136      return (this == o) ? 0 : instanceID.compareTo(o.instanceID);
137   }
138 
139}

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