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

COVERAGE SUMMARY FOR SOURCE FILE [ArchiveAllowedArguments.java]

nameclass, %method, %block, %line, %
ArchiveAllowedArguments.java75%  (3/4)62%  (10/16)65%  (71/110)70%  (15.4/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ArchiveAllowedArguments100% (1/1)38%  (3/8)51%  (36/70)57%  (7.4/13)
getSizes (): List 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/7)0%   (0/1)
toBuilder (): ArchiveAllowedArguments$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)
ArchiveAllowedArguments (List): void 100% (1/1)100% (10/10)100% (3/3)
builder (): ArchiveAllowedArguments$Builder 100% (1/1)100% (5/5)100% (1/1)
     
class ArchiveAllowedArguments$10%   (0/1)100% (0/0)100% (0/0)100% (0/0)
     
class ArchiveAllowedArguments$Builder100% (1/1)80%  (4/5)84%  (27/32)86%  (6/7)
fromArchiveAllowedArguments (ArchiveAllowedArguments): ArchiveAllowedArgument... 0%   (0/1)0%   (0/5)0%   (0/1)
ArchiveAllowedArguments$Builder (): void 100% (1/1)100% (6/6)100% (2/2)
archiveSizes (Integer []): ArchiveAllowedArguments$Builder 100% (1/1)100% (5/5)100% (1/1)
archiveSizes (List): ArchiveAllowedArguments$Builder 100% (1/1)100% (10/10)100% (2/2)
build (): ArchiveAllowedArguments 100% (1/1)100% (6/6)100% (1/1)
     
class ArchiveAllowedArguments$ConcreteBuilder100% (1/1)100% (3/3)100% (8/8)100% (2/2)
ArchiveAllowedArguments$ConcreteBuilder (): void 100% (1/1)100% (3/3)100% (1/1)
ArchiveAllowedArguments$ConcreteBuilder (ArchiveAllowedArguments$1): void 100% (1/1)100% (3/3)100% (1/1)
self (): ArchiveAllowedArguments$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.List;
23 
24import com.google.common.base.Objects;
25import com.google.common.base.Objects.ToStringHelper;
26import com.google.common.collect.ImmutableList;
27 
28/**
29 * The allowed arguments for archive manipulation, such as archivesize
30 *
31 * @author Adam Lowe
32 * @see <a href= "https://customer.glesys.com/api.php?a=doc#archive_allowedarguments" />
33 */
34public class ArchiveAllowedArguments {
35 
36   public static Builder<?> builder() {
37      return new ConcreteBuilder();
38   }
39 
40   public Builder<?> toBuilder() {
41      return new ConcreteBuilder().fromArchiveAllowedArguments(this);
42   }
43 
44   public abstract static class Builder<T extends Builder<T>> {
45      protected abstract T self();
46 
47      protected List<Integer> archiveSizes = ImmutableList.of();
48 
49      /**
50       * @see ArchiveAllowedArguments#getSizes()
51       */
52      public T archiveSizes(List<Integer> archiveSizes) {
53         this.archiveSizes = ImmutableList.copyOf(checkNotNull(archiveSizes, "archiveSizes"));
54         return self();
55      }
56 
57      public T archiveSizes(Integer... in) {
58         return archiveSizes(ImmutableList.copyOf(in));
59      }
60 
61      public ArchiveAllowedArguments build() {
62         return new ArchiveAllowedArguments(archiveSizes);
63      }
64 
65      public T fromArchiveAllowedArguments(ArchiveAllowedArguments in) {
66         return this.archiveSizes(in.getSizes());
67      }
68   }
69 
70   private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
71      @Override
72      protected ConcreteBuilder self() {
73         return this;
74      }
75   }
76 
77   private final List<Integer> archiveSizes;
78 
79   @ConstructorProperties({
80         "archivesize"
81   })
82   protected ArchiveAllowedArguments(List<Integer> archiveSizes) {
83      this.archiveSizes = ImmutableList.copyOf(checkNotNull(archiveSizes, "archiveSizes"));
84   }
85 
86   /**
87    * @return the list of allowed archive sizes, in GB
88    */
89   public List<Integer> getSizes() {
90      return this.archiveSizes;
91   }
92 
93   @Override
94   public int hashCode() {
95      return Objects.hashCode(archiveSizes);
96   }
97 
98   @Override
99   public boolean equals(Object obj) {
100      if (this == obj) return true;
101      if (obj == null || getClass() != obj.getClass()) return false;
102      ArchiveAllowedArguments that = ArchiveAllowedArguments.class.cast(obj);
103      return Objects.equal(this.archiveSizes, that.archiveSizes);
104   }
105 
106   protected ToStringHelper string() {
107      return Objects.toStringHelper("")
108            .add("archiveSizes", archiveSizes);
109   }
110 
111   @Override
112   public String toString() {
113      return string().toString();
114   }
115 
116}

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