Skip to content

Commit ce8f4a1

Browse files
committed
wip
1 parent fe435d1 commit ce8f4a1

1 file changed

Lines changed: 35 additions & 5 deletions

File tree

  • src/main/java/com/google/gcloud/storage

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)