1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.jclouds.blobstore.options;
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 public class CreateContainerOptions implements Cloneable {
37
38 public static final ImmutableCreateContainerOptions NONE = new ImmutableCreateContainerOptions(
39 new CreateContainerOptions());
40
41 private boolean publicRead;
42
43 public CreateContainerOptions() {
44 }
45
46 CreateContainerOptions(boolean publicRead) {
47 this.publicRead = publicRead;
48 }
49
50 public static class ImmutableCreateContainerOptions extends CreateContainerOptions {
51 private final CreateContainerOptions delegate;
52
53 public ImmutableCreateContainerOptions(CreateContainerOptions delegate) {
54 this.delegate = delegate;
55 }
56
57 @Override
58 public boolean isPublicRead() {
59 return delegate.isPublicRead();
60 }
61
62 @Override
63 public CreateContainerOptions publicRead() {
64 throw new UnsupportedOperationException();
65 }
66
67 @Override
68 public CreateContainerOptions clone() {
69 return delegate.clone();
70 }
71
72 @Override
73 public String toString() {
74 return delegate.toString();
75 }
76
77 }
78
79 public boolean isPublicRead() {
80 return publicRead;
81 }
82
83
84
85
86 public CreateContainerOptions publicRead() {
87
88 this.publicRead = true;
89 return this;
90 }
91
92 public static class Builder {
93
94
95
96
97 public static CreateContainerOptions publicRead() {
98 CreateContainerOptions options = new CreateContainerOptions();
99 return options.publicRead();
100 }
101
102 }
103
104 @Override
105 public CreateContainerOptions clone() {
106 return new CreateContainerOptions(publicRead);
107 }
108
109 @Override
110 public String toString() {
111 return "[publicRead=" + publicRead + "]";
112 }
113 }