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

COVERAGE SUMMARY FOR SOURCE FILE [PutOptions.java]

nameclass, %method, %block, %line, %
PutOptions.java67%  (2/3)21%  (3/14)23%  (17/75)29%  (6/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PutOptions$Builder0%   (0/1)0%   (0/2)0%   (0/10)0%   (0/3)
PutOptions$Builder (): void 0%   (0/1)0%   (0/3)0%   (0/1)
multipart (): PutOptions 0%   (0/1)0%   (0/7)0%   (0/2)
     
class PutOptions100% (1/1)29%  (2/7)26%  (11/43)27%  (3/11)
PutOptions (boolean): void 0%   (0/1)0%   (0/6)0%   (0/3)
clone (): PutOptions 0%   (0/1)0%   (0/6)0%   (0/1)
isMultipart (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
multipart (): PutOptions 0%   (0/1)0%   (0/5)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/12)0%   (0/1)
<static initializer> 100% (1/1)100% (8/8)100% (1/1)
PutOptions (): void 100% (1/1)100% (3/3)100% (2/2)
     
class PutOptions$ImmutablePutOptions100% (1/1)20%  (1/5)27%  (6/22)43%  (3/7)
clone (): PutOptions 0%   (0/1)0%   (0/4)0%   (0/1)
isMultipart (): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
multipart (): PutOptions 0%   (0/1)0%   (0/4)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/4)0%   (0/1)
PutOptions$ImmutablePutOptions (PutOptions): void 100% (1/1)100% (6/6)100% (3/3)

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.blobstore.options;
20 
21/**
22 * Contains options supported in the put blob operation. <h2>
23 * Usage</h2> The recommended way to instantiate a PutOptions object is to statically import
24 * PutOptions.* and invoke a static creation method followed by an instance mutator (if needed):
25 * <p/>
26 * <code>
27 * import static org.jclouds.blobstore.options.PutOptions.Builder.*
28 * eTag = blobStore.putBlob("container", blob, multipart());
29 * <code>
30 * 
31 * @author Adrian Cole
32 */
33public class PutOptions implements Cloneable {
34 
35   public static final ImmutablePutOptions NONE = new ImmutablePutOptions(new PutOptions());
36 
37   private boolean multipart;
38 
39   public PutOptions() {
40   }
41 
42   PutOptions(boolean multipart) {
43      this.multipart = multipart;
44   }
45 
46   public static class ImmutablePutOptions extends PutOptions {
47      private final PutOptions delegate;
48 
49      public ImmutablePutOptions(PutOptions delegate) {
50         this.delegate = delegate;
51      }
52 
53      @Override
54      public boolean isMultipart() {
55         return delegate.isMultipart();
56      }
57 
58      @Override
59      public PutOptions multipart() {
60         throw new UnsupportedOperationException();
61      }
62 
63      @Override
64      public PutOptions clone() {
65         return delegate.clone();
66      }
67 
68      @Override
69      public String toString() {
70         return delegate.toString();
71      }
72 
73   }
74 
75   public boolean isMultipart() {
76      return multipart;
77   }
78 
79   /**
80    * split large blobs into pieces, if supported by the provider
81    */
82   public PutOptions multipart() {
83      this.multipart = true;
84      return this;
85   }
86 
87   public static class Builder {
88 
89      /**
90       * @see PutOptions#multipart()
91       */
92      public static PutOptions multipart() {
93         PutOptions options = new PutOptions();
94         return options.multipart();
95      }
96 
97   }
98 
99   @Override
100   public PutOptions clone() {
101      return new PutOptions(multipart);
102   }
103 
104   @Override
105   public String toString() {
106      return "[multipart=" + multipart + "]";
107   }
108}

[all classes][org.jclouds.blobstore.options]
EMMA 2.0.5312 (C) Vladimir Roubtsov