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

COVERAGE SUMMARY FOR SOURCE FILE [EmailAccount.java]

nameclass, %method, %block, %line, %
EmailAccount.java75%  (3/4)61%  (19/31)75%  (231/307)74%  (38.4/52)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EmailAccount$10%   (0/1)100% (0/0)100% (0/0)100% (0/0)
     
class EmailAccount$Builder100% (1/1)83%  (10/12)71%  (94/132)86%  (18/21)
autoRespondMessage (String): EmailAccount$Builder 0%   (0/1)0%   (0/9)0%   (0/2)
fromEmailAccount (EmailAccount): EmailAccount$Builder 0%   (0/1)0%   (0/29)0%   (0/1)
EmailAccount$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
account (String): EmailAccount$Builder 100% (1/1)100% (9/9)100% (2/2)
antiVirus (boolean): EmailAccount$Builder 100% (1/1)100% (6/6)100% (2/2)
antispamLevel (int): EmailAccount$Builder 100% (1/1)100% (6/6)100% (2/2)
autoRespond (boolean): EmailAccount$Builder 100% (1/1)100% (6/6)100% (2/2)
autoRespondSaveEmail (boolean): EmailAccount$Builder 100% (1/1)100% (6/6)100% (2/2)
build (): EmailAccount 100% (1/1)100% (31/31)100% (1/1)
created (Date): EmailAccount$Builder 100% (1/1)100% (9/9)100% (2/2)
modified (Date): EmailAccount$Builder 100% (1/1)100% (9/9)100% (2/2)
quota (EmailQuota): EmailAccount$Builder 100% (1/1)100% (9/9)100% (2/2)
     
class EmailAccount100% (1/1)38%  (6/16)77%  (129/167)63%  (18.4/29)
getAccount (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getAntispamLevel (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getAutoRespondMessage (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getCreated (): Date 0%   (0/1)0%   (0/3)0%   (0/1)
getModified (): Date 0%   (0/1)0%   (0/3)0%   (0/1)
getQuota (): EmailQuota 0%   (0/1)0%   (0/3)0%   (0/1)
isAntiVirus (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
isAutoRespond (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
isAutoRespondSaveEmail (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
toBuilder (): EmailAccount$Builder 0%   (0/1)0%   (0/7)0%   (0/1)
equals (Object): boolean 100% (1/1)84%  (21/25)84%  (3.4/4)
EmailAccount (String, EmailQuota, int, GleSYSBoolean, GleSYSBoolean, String, ... 100% (1/1)100% (51/51)100% (11/11)
builder (): EmailAccount$Builder 100% (1/1)100% (5/5)100% (1/1)
hashCode (): int 100% (1/1)100% (9/9)100% (1/1)
string (): Objects$ToStringHelper 100% (1/1)100% (39/39)100% (1/1)
toString (): String 100% (1/1)100% (4/4)100% (1/1)
     
class EmailAccount$ConcreteBuilder100% (1/1)100% (3/3)100% (8/8)100% (2/2)
EmailAccount$ConcreteBuilder (): void 100% (1/1)100% (3/3)100% (1/1)
EmailAccount$ConcreteBuilder (EmailAccount$1): void 100% (1/1)100% (3/3)100% (1/1)
self (): EmailAccount$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 static com.google.common.base.Preconditions.checkNotNull;
20 
21import java.beans.ConstructorProperties;
22import java.util.Date;
23 
24import org.jclouds.javax.annotation.Nullable;
25 
26import com.google.common.base.Objects;
27import com.google.common.base.Objects.ToStringHelper;
28 
29/**
30 * Detailed information on an Email Account
31 *
32 * @author Adam Lowe
33 * @see <a href="https://customer.glesys.com/api.php?a=doc#email_list" />
34 */
35public class EmailAccount {
36 
37   public static Builder<?> builder() {
38      return new ConcreteBuilder();
39   }
40 
41   public Builder<?> toBuilder() {
42      return new ConcreteBuilder().fromEmailAccount(this);
43   }
44 
45   public abstract static class Builder<T extends Builder<T>> {
46      protected abstract T self();
47 
48      protected String account;
49      protected EmailQuota quota;
50      protected int antispamLevel;
51      protected boolean antiVirus;
52      protected boolean autoRespond;
53      protected String autoRespondMessage;
54      protected boolean autoRespondSaveEmail;
55      protected Date created;
56      protected Date modified;
57 
58      /**
59       * @see EmailAccount#getAccount()
60       */
61      public T account(String account) {
62         this.account = checkNotNull(account, "account");
63         return self();
64      }
65 
66      /**
67       * @see EmailAccount#getQuota()
68       */
69      public T quota(EmailQuota quota) {
70         this.quota = checkNotNull(quota, "quota");
71         return self();
72      }
73 
74      /**
75       * @see EmailAccount#getAntispamLevel()
76       */
77      public T antispamLevel(int antispamLevel) {
78         this.antispamLevel = antispamLevel;
79         return self();
80      }
81 
82      /**
83       * @see EmailAccount#isAntiVirus()
84       */
85      public T antiVirus(boolean antiVirus) {
86         this.antiVirus = antiVirus;
87         return self();
88      }
89 
90      /**
91       * @see EmailAccount#isAutoRespond()
92       */
93      public T autoRespond(boolean autoRespond) {
94         this.autoRespond = autoRespond;
95         return self();
96      }
97 
98      /**
99       * @see EmailAccount#getAutoRespondMessage()
100       */
101      public T autoRespondMessage(String autoRespondMessage) {
102         this.autoRespondMessage = checkNotNull(autoRespondMessage, "autoRespondMessage");
103         return self();
104      }
105 
106      /**
107       * @see EmailAccount#isAutoRespondSaveEmail()
108       */
109      public T autoRespondSaveEmail(boolean autoRespondSaveEmail) {
110         this.autoRespondSaveEmail = autoRespondSaveEmail;
111         return self();
112      }
113 
114      /**
115       * @see EmailAccount#getCreated()
116       */
117      public T created(Date created) {
118         this.created = checkNotNull(created, "created");
119         return self();
120      }
121 
122      /**
123       * @see EmailAccount#getModified()
124       */
125      public T modified(Date modified) {
126         this.modified = checkNotNull(modified, "modified");
127         return self();
128      }
129 
130      public EmailAccount build() {
131         return new EmailAccount(account, quota, antispamLevel, new GleSYSBoolean(antiVirus), new GleSYSBoolean(autoRespond), autoRespondMessage, new GleSYSBoolean(autoRespondSaveEmail), created, modified);
132      }
133 
134      public T fromEmailAccount(EmailAccount in) {
135         return this.account(in.getAccount())
136               .quota(in.getQuota())
137               .antispamLevel(in.getAntispamLevel())
138               .antiVirus(in.isAntiVirus())
139               .autoRespond(in.isAutoRespond())
140               .autoRespondMessage(in.getAutoRespondMessage())
141               .autoRespondSaveEmail(in.isAutoRespondSaveEmail())
142               .created(in.getCreated())
143               .modified(in.getModified());
144      }
145   }
146 
147   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
148      @Override
149      protected ConcreteBuilder self() {
150         return this;
151      }
152   }
153 
154   private final String account;
155   private final EmailQuota quota;
156   private final int antispamLevel;
157   private final boolean antiVirus;
158   private final boolean autoRespond;
159   private final String autoRespondMessage;
160   private final boolean autoRespondSaveEmail;
161   private final Date created;
162   private final Date modified;
163 
164   @ConstructorProperties({
165         "emailaccount", "quota", "antispamlevel", "antivirus", "autorespond", "autorespondmessage", "autorespondsaveemail", "created", "modified"
166   })
167   protected EmailAccount(String account, EmailQuota quota, int antispamLevel,
168                          GleSYSBoolean antiVirus, GleSYSBoolean autoRespond, @Nullable String autoRespondMessage,
169                          GleSYSBoolean autoRespondSaveEmail, Date created, @Nullable Date modified) {
170      this.account = checkNotNull(account, "account");
171      this.quota = checkNotNull(quota, "quota");
172      this.antispamLevel = antispamLevel;
173      this.antiVirus = checkNotNull(antiVirus, "antiVirus").getValue();
174      this.autoRespond = checkNotNull(autoRespond, "autoRespond").getValue();
175      this.autoRespondMessage = autoRespondMessage;
176      this.autoRespondSaveEmail = checkNotNull(autoRespondSaveEmail, "autoRespondSaveEmail").getValue();
177      this.created = checkNotNull(created, "created");
178      this.modified = modified;
179   }
180 
181   /**
182    * @return the e-mail address for this e-mail account
183    */
184   public String getAccount() {
185      return this.account;
186   }
187 
188   /**
189    * @return the quota for this e-mail account
190    */
191   public EmailQuota getQuota() {
192      return this.quota;
193   }
194 
195   /**
196    * @return the antispam level of the e-mail account
197    */
198   public int getAntispamLevel() {
199      return this.antispamLevel;
200   }
201 
202   /**
203    * @return true if antivirus is enabled for this e-mail account
204    */
205   public boolean isAntiVirus() {
206      return this.antiVirus;
207   }
208 
209   /**
210    * @return true if auto-respond is enabled for this e-mail account
211    */
212   public boolean isAutoRespond() {
213      return this.autoRespond;
214   }
215   /**
216    * @return the auto-respond message for this e-mail account
217    */
218   @Nullable
219   public String getAutoRespondMessage() {
220      return this.autoRespondMessage;
221   }
222 
223   /**
224    * @return true if saving is enabled for auto-respond e-mails
225    */
226   public boolean isAutoRespondSaveEmail() {
227      return this.autoRespondSaveEmail;
228   }
229 
230   /**
231    * @return when this account was created
232    */
233   public Date getCreated() {
234      return this.created;
235   }
236 
237   /**
238    * @return when this account was last modified
239    */
240   @Nullable
241   public Date getModified() {
242      return this.modified;
243   }
244 
245   @Override
246   public int hashCode() {
247      return Objects.hashCode(account);
248   }
249 
250   @Override
251   public boolean equals(Object obj) {
252      if (this == obj) return true;
253      if (obj == null || getClass() != obj.getClass()) return false;
254      EmailAccount that = EmailAccount.class.cast(obj);
255      return Objects.equal(this.account, that.account);
256   }
257 
258   protected ToStringHelper string() {
259      return Objects.toStringHelper("")
260            .add("account", account).add("quota", quota).add("antispamLevel", antispamLevel).add("antiVirus", antiVirus).add("autoRespond", autoRespond).add("autoRespondMessage", autoRespondMessage).add("autoRespondSaveEmail", autoRespondSaveEmail).add("created", created).add("modified", modified);
261   }
262 
263   @Override
264   public String toString() {
265      return string().toString();
266   }
267 
268}

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