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

COVERAGE SUMMARY FOR SOURCE FILE [Section.java]

nameclass, %method, %block, %line, %
Section.java100% (2/2)55%  (6/11)38%  (40/106)41%  (11.9/29)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Section100% (1/1)43%  (3/7)30%  (26/87)33%  (7.9/24)
builder (): Section$Builder 0%   (0/1)0%   (0/4)0%   (0/1)
equals (Object): boolean 0%   (0/1)0%   (0/37)0%   (0/13)
toBuilder (): Section$Builder 0%   (0/1)0%   (0/6)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/12)0%   (0/1)
hashCode (): int 100% (1/1)89%  (17/19)97%  (3.9/4)
Section (String): void 100% (1/1)100% (6/6)100% (3/3)
getInfo (): String 100% (1/1)100% (3/3)100% (1/1)
     
class Section$Builder100% (1/1)75%  (3/4)74%  (14/19)80%  (4/5)
fromSection (Section): Section$Builder 0%   (0/1)0%   (0/5)0%   (0/1)
Section$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
build (): Section 100% (1/1)100% (6/6)100% (1/1)
info (String): Section$Builder 100% (1/1)100% (5/5)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.ovf;
20 
21import org.jclouds.javax.annotation.Nullable;
22 
23/**
24 * Metadata about a virtual machine or grouping of them
25 * 
26 * @author Adrian Cole
27 */
28public class Section<T extends Section<T>> {
29 
30   public static <T extends Section<T>> Builder<T> builder() {
31      return new Builder<T>();
32   }
33 
34   public Builder<T> toBuilder() {
35      return new Builder<T>().fromSection(this);
36   }
37 
38   public static class Builder<T extends Section<T>> {
39      protected String info;
40 
41      /**
42       * @see Section#getInfo
43       */
44      public Builder<T> info(String info) {
45         this.info = info;
46         return this;
47      }
48 
49      public Section<T> build() {
50         return new Section<T>(info);
51      }
52 
53      public Builder<T> fromSection(Section<T> in) {
54         return info(in.getInfo());
55      }
56   }
57 
58   protected final String info;
59 
60   public Section(@Nullable String info) {
61      this.info = info;
62   }
63 
64   /**
65    * 
66    * @return ovf info
67    */
68   public String getInfo() {
69      return info;
70   }
71 
72   @Override
73   public int hashCode() {
74      final int prime = 31;
75      int result = 1;
76      result = prime * result + ((info == null) ? 0 : info.hashCode());
77      return result;
78   }
79 
80   @Override
81   public boolean equals(Object obj) {
82      if (this == obj)
83         return true;
84      if (obj == null)
85         return false;
86      if (getClass() != obj.getClass())
87         return false;
88      Section<?> other = (Section<?>) obj;
89      if (info == null) {
90         if (other.info != null)
91            return false;
92      } else if (!info.equals(other.info))
93         return false;
94      return true;
95   }
96 
97   @Override
98   public String toString() {
99      return "[info=" + getInfo() + "]";
100   }
101 
102}

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