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

COVERAGE SUMMARY FOR SOURCE FILE [ManagedElement.java]

nameclass, %method, %block, %line, %
ManagedElement.java100% (2/2)46%  (6/13)40%  (38/94)61%  (11/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ManagedElement100% (1/1)17%  (1/6)22%  (11/50)44%  (4/9)
builder (): ManagedElement$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
getCaption (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
toBuilder (): ManagedElement$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/25)0%   (0/1)
ManagedElement (String, String, String, String): void 100% (1/1)100% (11/11)100% (4/4)
     
class ManagedElement$Builder100% (1/1)71%  (5/7)61%  (27/44)78%  (7/9)
fromManagedElement (ManagedElement): ManagedElement$Builder 0%   (0/1)0%   (0/10)0%   (0/1)
fromSettingData (SettingData): ManagedElement$Builder 0%   (0/1)0%   (0/7)0%   (0/1)
ManagedElement$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
caption (String): ManagedElement$Builder 100% (1/1)100% (5/5)100% (2/2)
description (String): ManagedElement$Builder 100% (1/1)100% (5/5)100% (2/2)
elementName (String): ManagedElement$Builder 100% (1/1)100% (7/7)100% (1/1)
instanceID (String): ManagedElement$Builder 100% (1/1)100% (7/7)100% (1/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.cim;
20 
21 
22/**
23 * 
24 * ManagedElement is an abstract class that provides a common superclass (or top of the inheritance
25 * tree) for the non-association classes in the CIM Schema.
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 ManagedElement extends SettingData {
34   public static Builder builder() {
35      return new Builder();
36   }
37 
38   /**
39    * {@inheritDoc}
40    */
41   @Override
42   public Builder toBuilder() {
43      return builder().fromManagedElement(this);
44   }
45 
46   public static class Builder extends SettingData.Builder {
47      protected String caption;
48      protected String description;
49 
50      /**
51       * @see ManagedSettingData#getCaption
52       */
53      public Builder caption(String caption) {
54         this.caption = caption;
55         return this;
56      }
57 
58      /**
59       * @see ManagedSettingData#getDescription
60       */
61      public Builder description(String description) {
62         this.description = description;
63         return this;
64      }
65 
66      public Builder fromManagedElement(ManagedElement in) {
67         return caption(in.getCaption()).description(in.getDescription()).fromSettingData(in);
68      }
69 
70      /**
71       * {@inheritDoc}
72       */
73      @Override
74      public Builder fromSettingData(SettingData in) {
75         return Builder.class.cast(super.fromSettingData(in));
76      }
77 
78      /**
79       * {@inheritDoc}
80       */
81      @Override
82      public Builder elementName(String elementName) {
83         return Builder.class.cast(super.elementName(elementName));
84      }
85 
86      /**
87       * {@inheritDoc}
88       */
89      @Override
90      public Builder instanceID(String instanceID) {
91         return Builder.class.cast(super.instanceID(instanceID));
92      }
93 
94   }
95 
96   protected final String caption;
97   protected final String description;
98 
99   public ManagedElement(String elementName, String instanceID, String caption, String description) {
100      super(elementName, instanceID);
101      this.caption = caption;
102      this.description = description;
103   }
104 
105   /**
106    * The Caption property is a short textual description (one- line string) of the object.
107    */
108   public String getCaption() {
109      return caption;
110   }
111 
112   /**
113    * The Description property provides a textual description of the object.
114    */
115   public String getDescription() {
116      return description;
117   }
118 
119   @Override
120   public String toString() {
121      return String.format("[elementName=%s, instanceID=%s, caption=%s, description=%s]", elementName, instanceID,
122               caption, description);
123   }
124 
125}

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