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

COVERAGE SUMMARY FOR SOURCE FILE [Property.java]

nameclass, %method, %block, %line, %
Property.java100% (2/2)69%  (11/16)75%  (120/161)72%  (28.9/40)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Property$Builder100% (1/1)86%  (6/7)71%  (35/49)91%  (10/11)
fromProperty (Property): Property$Builder 0%   (0/1)0%   (0/14)0%   (0/1)
Property$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): Property 100% (1/1)100% (12/12)100% (1/1)
description (String): Property$Builder 100% (1/1)100% (5/5)100% (2/2)
key (String): Property$Builder 100% (1/1)100% (5/5)100% (2/2)
label (String): Property$Builder 100% (1/1)100% (5/5)100% (2/2)
value (String): Property$Builder 100% (1/1)100% (5/5)100% (2/2)
     
class Property100% (1/1)56%  (5/9)76%  (85/112)65%  (18.9/29)
getDescription (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getKey (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getLabel (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getValue (): String 0%   (0/1)0%   (0/3)0%   (0/1)
equals (Object): boolean 100% (1/1)65%  (24/37)54%  (7/13)
hashCode (): int 100% (1/1)89%  (17/19)97%  (3.9/4)
Property (String, String, String, String): void 100% (1/1)100% (15/15)100% (6/6)
builder (): Property$Builder 100% (1/1)100% (4/4)100% (1/1)
toString (): String 100% (1/1)100% (25/25)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.ovf;
20 
21/**
22 * 
23 * @author Adrian Cole
24 */
25public class Property {
26   public static Builder builder() {
27      return new Builder();
28   }
29 
30   public static class Builder {
31      protected String key;
32      protected String value;
33      protected String label;
34      protected String description;
35 
36      /**
37       * @see Property#getKey
38       */
39      public Builder key(String key) {
40         this.key = key;
41         return this;
42      }
43 
44      /**
45       * @see Property#getValue
46       */
47      public Builder value(String value) {
48         this.value = value;
49         return this;
50      }
51 
52      /**
53       * @see Section#getLabel
54       */
55      public Builder label(String label) {
56         this.label = label;
57         return this;
58      }
59 
60      /**
61       * @see Section#getDescription
62       */
63      public Builder description(String description) {
64         this.description = description;
65         return this;
66      }
67 
68      public Property build() {
69         return new Property(key, value, label, description);
70      }
71 
72      public Builder fromProperty(Property in) {
73         return key(in.getKey()).value(in.getValue()).description(in.getDescription()).label(in.getLabel());
74      }
75   }
76 
77   private final String key;
78   private final String value;
79   private final String label;
80   private final String description;
81 
82   public Property(String key, String value, String label, String description) {
83      this.key = key;
84      this.value = value;
85      this.label = label;
86      this.description = description;
87   }
88 
89   @Override
90   public int hashCode() {
91      final int prime = 31;
92      int result = 1;
93      result = prime * result + ((key == null) ? 0 : key.hashCode());
94      return result;
95   }
96 
97   @Override
98   public boolean equals(Object obj) {
99      if (this == obj)
100         return true;
101      if (obj == null)
102         return false;
103      if (getClass() != obj.getClass())
104         return false;
105      Property other = (Property) obj;
106      if (key == null) {
107         if (other.key != null)
108            return false;
109      } else if (!key.equals(other.key))
110         return false;
111      return true;
112   }
113 
114   @Override
115   public String toString() {
116      return String.format("[key=%s, value=%s, label=%s, description=%s]", key, value, label, description);
117   }
118 
119   public String getKey() {
120      return key;
121   }
122 
123   public String getDescription() {
124      return description;
125   }
126 
127   public String getLabel() {
128      return label;
129   }
130 
131   public String getValue() {
132      return value;
133   }
134}

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