EMMA Coverage Report (generated Wed Jun 22 19:47:49 EDT 2011)
[all classes][org.jclouds.cloudfiles.domain]

COVERAGE SUMMARY FOR SOURCE FILE [ContainerCDNMetadata.java]

nameclass, %method, %block, %line, %
ContainerCDNMetadata.java100% (1/1)31%  (4/13)21%  (33/154)30%  (10.8/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ContainerCDNMetadata100% (1/1)31%  (4/13)21%  (33/154)30%  (10.8/36)
equals (Object): boolean 0%   (0/1)0%   (0/37)0%   (0/13)
getCDNUri (): URI 0%   (0/1)0%   (0/3)0%   (0/1)
getReferrerACL (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getTTL (): long 0%   (0/1)0%   (0/3)0%   (0/1)
getUseragentACL (): String 0%   (0/1)0%   (0/3)0%   (0/1)
hashCode (): int 0%   (0/1)0%   (0/19)0%   (0/4)
isCDNEnabled (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
isLogRetention (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/43)0%   (0/1)
compareTo (ContainerCDNMetadata): int 100% (1/1)75%  (12/16)60%  (1.8/3)
ContainerCDNMetadata (): void 100% (1/1)100% (3/3)100% (2/2)
ContainerCDNMetadata (String, boolean, long, URI): void 100% (1/1)100% (15/15)100% (6/6)
getName (): String 100% (1/1)100% (3/3)100% (1/1)

1/**
2 *
3 * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4 *
5 * ====================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * 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, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ====================================================================
18 */
19package org.jclouds.cloudfiles.domain;
20 
21import java.net.URI;
22 
23/**
24 * 
25 * @author James Murty
26 * 
27 */
28public class ContainerCDNMetadata implements Comparable<ContainerCDNMetadata> {
29 
30   /** The serialVersionUID */
31   private static final long serialVersionUID = 8373435988423605652L;
32   private String name;
33   private boolean cdn_enabled;
34   private long ttl;
35   private URI cdn_uri;
36   private String referrer_acl;
37   private String useragent_acl;
38   private boolean log_retention;
39 
40   public ContainerCDNMetadata(String name, boolean cdnEnabled, long ttl, URI cdnUri) {
41      this.name = name;
42      this.cdn_enabled = cdnEnabled;
43      this.ttl = ttl;
44      this.cdn_uri = cdnUri;
45   }
46 
47   public ContainerCDNMetadata() {
48   }
49 
50   /**
51    * Beware: The container name is not available from HEAD CDN responses and will be null. return
52    * the name of the container to which these CDN settings apply.
53    */
54   public String getName() {
55      return name;
56   }
57 
58   public URI getCDNUri() {
59      return cdn_uri;
60   }
61 
62   public long getTTL() {
63      return ttl;
64   }
65 
66   public boolean isCDNEnabled() {
67      return cdn_enabled;
68   }
69 
70   public int compareTo(ContainerCDNMetadata o) {
71      if (getName() == null)
72         return -1;
73      return (this == o) ? 0 : getName().compareTo(o.getName());
74   }
75 
76   @Override
77   public int hashCode() {
78      final int prime = 31;
79      int result = 1;
80      result = prime * result + ((cdn_uri == null) ? 0 : cdn_uri.hashCode());
81      return result;
82   }
83 
84   @Override
85   public boolean equals(Object obj) {
86      if (this == obj)
87         return true;
88      if (obj == null)
89         return false;
90      if (getClass() != obj.getClass())
91         return false;
92      ContainerCDNMetadata other = (ContainerCDNMetadata) obj;
93      if (cdn_uri == null) {
94         if (other.cdn_uri != null)
95            return false;
96      } else if (!cdn_uri.equals(other.cdn_uri))
97         return false;
98      return true;
99   }
100 
101   public String getReferrerACL() {
102      return referrer_acl;
103   }
104 
105   public String getUseragentACL() {
106      return useragent_acl;
107   }
108 
109   public boolean isLogRetention() {
110      return log_retention;
111   }
112 
113   @Override
114   public String toString() {
115      return String.format(
116               "[name=%s, cdn_uri=%s, cdn_enabled=%s, log_retention=%s, referrer_acl=%s, ttl=%s, useragent_acl=%s]",
117               name, cdn_uri, cdn_enabled, log_retention, referrer_acl, ttl, useragent_acl);
118   }
119}

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