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

COVERAGE SUMMARY FOR SOURCE FILE [EmailOverviewDomain.java]

nameclass, %method, %block, %line, %
EmailOverviewDomain.java75%  (3/4)58%  (11/19)58%  (83/142)69%  (19.4/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EmailOverviewDomain100% (1/1)30%  (3/10)46%  (41/89)55%  (9.4/17)
get (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getAccounts (): int 0%   (0/1)0%   (0/3)0%   (0/1)
getAliases (): int 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/9)0%   (0/1)
string (): Objects$ToStringHelper 0%   (0/1)0%   (0/15)0%   (0/1)
toBuilder (): EmailOverviewDomain$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)84%  (21/25)84%  (3.4/4)
EmailOverviewDomain (String, int, int): void 100% (1/1)100% (15/15)100% (5/5)
builder (): EmailOverviewDomain$Builder 100% (1/1)100% (5/5)100% (1/1)
     
class EmailOverviewDomain$10%   (0/1)100% (0/0)100% (0/0)100% (0/0)
     
class EmailOverviewDomain$Builder100% (1/1)83%  (5/6)76%  (34/45)89%  (8/9)
fromEmailOverviewDomain (EmailOverviewDomain): EmailOverviewDomain$Builder 0%   (0/1)0%   (0/11)0%   (0/1)
EmailOverviewDomain$Builder (): void 100% (1/1)100% (3/3)100% (1/1)
accounts (int): EmailOverviewDomain$Builder 100% (1/1)100% (6/6)100% (2/2)
aliases (int): EmailOverviewDomain$Builder 100% (1/1)100% (6/6)100% (2/2)
build (): EmailOverviewDomain 100% (1/1)100% (10/10)100% (1/1)
domain (String): EmailOverviewDomain$Builder 100% (1/1)100% (9/9)100% (2/2)
     
class EmailOverviewDomain$ConcreteBuilder100% (1/1)100% (3/3)100% (8/8)100% (2/2)
EmailOverviewDomain$ConcreteBuilder (): void 100% (1/1)100% (3/3)100% (1/1)
EmailOverviewDomain$ConcreteBuilder (EmailOverviewDomain$1): void 100% (1/1)100% (3/3)100% (1/1)
self (): EmailOverviewDomain$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;
22 
23import com.google.common.annotations.Beta;
24import com.google.common.base.Objects;
25import com.google.common.base.Objects.ToStringHelper;
26 
27/**
28 * Detailed information about e-mail settings for a single domain
29 *
30 * @author Adam Lowe
31 * @see <a href="https://customer.glesys.com/api.php?a=doc#email_overview" />
32 */
33@Beta
34public class EmailOverviewDomain {
35 
36   public static Builder<?> builder() {
37      return new ConcreteBuilder();
38   }
39 
40   public Builder<?> toBuilder() {
41      return new ConcreteBuilder().fromEmailOverviewDomain(this);
42   }
43 
44   public abstract static class Builder<T extends Builder<T>> {
45      protected abstract T self();
46 
47      protected String domain;
48      protected int accounts;
49      protected int aliases;
50 
51      /**
52       * @see EmailOverviewDomain#get()
53       */
54      public T domain(String domain) {
55         this.domain = checkNotNull(domain, "domain");
56         return self();
57      }
58 
59      /**
60       * @see EmailOverviewDomain#getAccounts()
61       */
62      public T accounts(int accounts) {
63         this.accounts = accounts;
64         return self();
65      }
66 
67      /**
68       * @see EmailOverviewDomain#getAliases()
69       */
70      public T aliases(int aliases) {
71         this.aliases = aliases;
72         return self();
73      }
74 
75      public EmailOverviewDomain build() {
76         return new EmailOverviewDomain(domain, accounts, aliases);
77      }
78 
79      public T fromEmailOverviewDomain(EmailOverviewDomain in) {
80         return this.domain(in.get()).accounts(in.getAccounts()).aliases(in.getAliases());
81      }
82   }
83 
84   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
85      @Override
86      protected ConcreteBuilder self() {
87         return this;
88      }
89   }
90 
91   private final String domain;
92   private final int accounts;
93   private final int aliases;
94 
95   @ConstructorProperties({
96         "domainname", "accounts", "aliases"
97   })
98   protected EmailOverviewDomain(String domain, int accounts, int aliases) {
99      this.domain = checkNotNull(domain, "domain");
100      this.accounts = accounts;
101      this.aliases = aliases;
102   }
103 
104   /** @return the domain name */
105   public String get() {
106      return this.domain;
107   }
108 
109   /** @return the number of e-mail accounts in the domain */
110   public int getAccounts() {
111      return this.accounts;
112   }
113 
114   /** @return the number of e-mail aliases in the domain */
115   public int getAliases() {
116      return this.aliases;
117   }
118 
119   @Override
120   public int hashCode() {
121      return Objects.hashCode(domain);
122   }
123 
124   @Override
125   public boolean equals(Object obj) {
126      if (this == obj) return true;
127      if (obj == null || getClass() != obj.getClass()) return false;
128      EmailOverviewDomain that = EmailOverviewDomain.class.cast(obj);
129      return Objects.equal(this.domain, that.domain);
130   }
131 
132   protected ToStringHelper string() {
133      return Objects.toStringHelper("").add("domain", domain).add("accounts", accounts).add("aliases", aliases);
134   }
135 
136   @Override
137   public String toString() {
138      return string().toString();
139   }
140 
141}

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