Skip to content

Commit bc89708

Browse files
committed
---
yaml --- r: 5927 b: refs/heads/tswast-patch-1 c: ce8f4a1 h: refs/heads/master i: 5925: 5f482a2 5923: 239fc92 5919: 42ea42a
1 parent fbbff94 commit bc89708

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

  • branches/tswast-patch-1/src/main/java/com/google/gcloud/storage

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: fe435d1ddef53b3029a43b96601ebd3621da9ffb
60+
refs/heads/tswast-patch-1: ce8f4a1b5e69f3f7d85716a1e895085136e93c3a
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/src/main/java/com/google/gcloud/storage/Acl.java

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,33 @@ public enum Type {
3838
PROJECT
3939
}
4040

41+
public static class Builder {
42+
private Builder() {
43+
44+
}
45+
46+
Acl build()
47+
}
48+
49+
public static class Domain extends Acl {
50+
51+
private final String domain;
52+
53+
Domain(Role role, String domain) {
54+
super(Type.USER, role);
55+
this.email = email;
56+
}
57+
58+
public static User domain(Role role, String domain) {
59+
return new User(role, email);
60+
}
61+
}
62+
4163
public static class User extends Acl {
4264

4365
private static final long serialVersionUID = 3076518036392737008L;
4466

45-
private String email;
67+
private final String email;
4668

4769
User(Role role, String email) {
4870
super(Type.USER, role);
@@ -53,20 +75,20 @@ String email() {
5375
return email;
5476
}
5577

56-
public static User forEmail(Role role, String email) {
78+
public static User email(Role role, String email) {
5779
return new User(role, email);
5880
}
5981

6082
public static User allUsers(Role role) {
61-
return forEmail(role, "allUsers");
83+
return email(role, "allUsers");
6284
}
6385

6486
public static User allAuthenticatedUsers(Role role) {
65-
return forEmail(role, "allAuthenticatedUsers");
87+
return email(role, "allAuthenticatedUsers");
6688
}
6789
}
6890

69-
91+
7092
Acl(Type type, Role role) {
7193
this.type = type;
7294
this.role = role;
@@ -80,4 +102,12 @@ public Type type() {
80102
public Role role() {
81103
return role;
82104
}
105+
106+
public Builder toBuilder() {
107+
108+
}
109+
110+
public static Builder builder() {
111+
return new Builder();
112+
}
83113
}

0 commit comments

Comments
 (0)