EMMA Coverage Report (generated Mon Dec 09 15:12:29 EST 2013)
[all classes][org.jclouds.glesys.domain]

COVERAGE SUMMARY FOR SOURCE FILE [EmailOverviewSummary.java]

nameclass, %method, %block, %line, %
EmailOverviewSummary.java75%  (3/4)57%  (12/21)57%  (117/206)70%  (22.3/32)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EmailOverviewSummary100% (1/1)27%  (3/11)48%  (70/145)54%  (10.3/19)
getAccounts (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getAliases (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getMaxAccounts (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getMaxAliases (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/28)0%   (0/1)
string (): Objects$ToStringHelper 0%   (0/1)0%   (0/19)0%   (0/1)
toBuilder (): EmailOverviewSummary$Builder 0%   (0/1)0%   (0/7)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)
equals (Object): boolean 100% (1/1)91%  (50/55)84%  (3.3/4)
EmailOverviewSummary (int, int, int, int): void 100% (1/1)100% (15/15)100% (6/6)
builder (): EmailOverviewSummary$Builder 100% (1/1)100% (5/5)100% (1/1)
     
class EmailOverviewSummary$10%   (0/1)100% (0/0)100% (0/0)100% (0/0)
     
class EmailOverviewSummary$Builder100% (1/1)86%  (6/7)74%  (39/53)91%  (10/11)
fromEmailOverviewSummary (EmailOverviewSummary): EmailOverviewSummary$Builder 0%   (0/1)0%   (0/14)0%   (0/1)
EmailOverviewSummary$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
accounts (int): EmailOverviewSummary$Builder 100% (1/1)100% (6/6)100% (2/2)
aliases (int): EmailOverviewSummary$Builder 100% (1/1)100% (6/6)100% (2/2)
build (): EmailOverviewSummary 100% (1/1)100% (12/12)100% (1/1)
maxAccounts (int): EmailOverviewSummary$Builder 100% (1/1)100% (6/6)100% (2/2)
maxAliases (int): EmailOverviewSummary$Builder 100% (1/1)100% (6/6)100% (2/2)
     
class EmailOverviewSummary$ConcreteBuilder100% (1/1)100% (3/3)100% (8/8)100% (2/2)
EmailOverviewSummary$ConcreteBuilder (): void 100% (1/1)100% (3/3)100% (1/1)
EmailOverviewSummary$ConcreteBuilder (EmailOverviewSummary$1): void 100% (1/1)100% (3/3)100% (1/1)
self (): EmailOverviewSummary$ConcreteBuilder 100% (1/1)100% (2/2)100% (1/1)

1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package org.jclouds.glesys.domain;
18 
19import java.beans.ConstructorProperties;
20 
21import com.google.common.annotations.Beta;
22import com.google.common.base.Objects;
23import com.google.common.base.Objects.ToStringHelper;
24 
25/**
26 * Summary information of e-mail settings and limits for a GleSYS account
27 *
28 * @author Adam Lowe
29 * @see <a href="https://customer.glesys.com/api.php?a=doc#email_overview" />
30 */
31//TODO: find a better name for this class
32@Beta
33public class EmailOverviewSummary {
34 
35   public static Builder<?> builder() {
36      return new ConcreteBuilder();
37   }
38 
39   public Builder<?> toBuilder() {
40      return new ConcreteBuilder().fromEmailOverviewSummary(this);
41   }
42 
43   public abstract static class Builder<T extends Builder<T>> {
44      protected abstract T self();
45 
46      protected int accounts;
47      protected int maxAccounts;
48      protected int aliases;
49      protected int maxAliases;
50 
51      /**
52       * @see EmailOverviewSummary#getAccounts()
53       */
54      public T accounts(int accounts) {
55         this.accounts = accounts;
56         return self();
57      }
58 
59      /**
60       * @see EmailOverviewSummary#getMaxAccounts()
61       */
62      public T maxAccounts(int maxAccounts) {
63         this.maxAccounts = maxAccounts;
64         return self();
65      }
66 
67      /**
68       * @see EmailOverviewSummary#getAliases()
69       */
70      public T aliases(int aliases) {
71         this.aliases = aliases;
72         return self();
73      }
74 
75      /**
76       * @see EmailOverviewSummary#getMaxAliases()
77       */
78      public T maxAliases(int maxAliases) {
79         this.maxAliases = maxAliases;
80         return self();
81      }
82 
83      public EmailOverviewSummary build() {
84         return new EmailOverviewSummary(accounts, maxAccounts, aliases, maxAliases);
85      }
86 
87      public T fromEmailOverviewSummary(EmailOverviewSummary in) {
88         return this.accounts(in.getAccounts())
89               .maxAccounts(in.getMaxAccounts())
90               .aliases(in.getAliases())
91               .maxAliases(in.getMaxAliases());
92      }
93   }
94 
95   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
96      @Override
97      protected ConcreteBuilder self() {
98         return this;
99      }
100   }
101 
102   private final int accounts;
103   private final int maxAccounts;
104   private final int aliases;
105   private final int maxAliases;
106 
107   @ConstructorProperties({
108         "accounts", "maxaccounts", "aliases", "maxaliases"
109   })
110   protected EmailOverviewSummary(int accounts, int maxAccounts, int aliases, int maxAliases) {
111      this.accounts = accounts;
112      this.maxAccounts = maxAccounts;
113      this.aliases = aliases;
114      this.maxAliases = maxAliases;
115   }
116 
117   /**
118    * @return the number of e-mail accounts
119    */
120   public int getAccounts() {
121      return this.accounts;
122   }
123 
124   /**
125    * @return the maximum number of e-mail accounts
126    */
127   public int getMaxAccounts() {
128      return this.maxAccounts;
129   }
130 
131   /**
132    * @return the number of e-mail aliases
133    */
134   public int getAliases() {
135      return this.aliases;
136   }
137 
138   /**
139    * @return the maximum number of e-mail aliases
140    */
141   public int getMaxAliases() {
142      return this.maxAliases;
143   }
144 
145   @Override
146   public int hashCode() {
147      return Objects.hashCode(accounts, maxAccounts, aliases, maxAliases);
148   }
149 
150   @Override
151   public boolean equals(Object obj) {
152      if (this == obj) return true;
153      if (obj == null || getClass() != obj.getClass()) return false;
154      EmailOverviewSummary that = EmailOverviewSummary.class.cast(obj);
155      return Objects.equal(this.accounts, that.accounts)
156            && Objects.equal(this.maxAccounts, that.maxAccounts)
157            && Objects.equal(this.aliases, that.aliases)
158            && Objects.equal(this.maxAliases, that.maxAliases);
159   }
160 
161   protected ToStringHelper string() {
162      return Objects.toStringHelper("")
163            .add("accounts", accounts).add("maxAccounts", maxAccounts).add("aliases", aliases).add("maxAliases", maxAliases);
164   }
165 
166   @Override
167   public String toString() {
168      return string().toString();
169   }
170 
171}

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