Skip to content

Commit 5376eff

Browse files
committed
Consistently order fields in Acl, update serialVersionUID
1 parent b0046d0 commit 5376eff

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

  • google-cloud-storage/src/main/java/com/google/cloud/storage

google-cloud-storage/src/main/java/com/google/cloud/storage/Acl.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
*/
3535
public final class Acl implements Serializable {
3636

37-
private static final long serialVersionUID = 6435575339887912222L;
38-
37+
private static final long serialVersionUID = 7516713233557576082L;
3938
static final Function<ObjectAccessControl, Acl> FROM_OBJECT_PB_FUNCTION =
4039
new Function<ObjectAccessControl, Acl>() {
4140
@Override
@@ -51,10 +50,10 @@ public Acl apply(BucketAccessControl aclPb) {
5150
}
5251
};
5352

54-
private final String id;
55-
private final String etag;
5653
private final Entity entity;
5754
private final Role role;
55+
private final String id;
56+
private final String etag;
5857

5958
public enum Role {
6059
OWNER, READER, WRITER
@@ -359,33 +358,33 @@ private Acl(Builder builder) {
359358
}
360359

361360
/**
362-
* Returns the ID of the ACL entry.
361+
* Returns the entity for this ACL object.
363362
*/
364-
public String id() {
365-
return id;
363+
public Entity entity() {
364+
return entity;
366365
}
367366

368367
/**
369-
* Returns HTTP 1.1 Entity tag for the ACL entry.
370-
*
371-
* @see <a href="http://tools.ietf.org/html/rfc2616#section-3.11">Entity Tags</a>
368+
* Returns the role associated to the entity in this ACL object.
372369
*/
373-
public String etag() {
374-
return etag;
370+
public Role role() {
371+
return role;
375372
}
376373

377374
/**
378-
* Returns the entity for this ACL object.
375+
* Returns the ID of the ACL entry.
379376
*/
380-
public Entity entity() {
381-
return entity;
377+
public String id() {
378+
return id;
382379
}
383380

384381
/**
385-
* Returns the role associated to the entity in this ACL object.
382+
* Returns HTTP 1.1 Entity tag for the ACL entry.
383+
*
384+
* @see <a href="http://tools.ietf.org/html/rfc2616#section-3.11">Entity Tags</a>
386385
*/
387-
public Role role() {
388-
return role;
386+
public String etag() {
387+
return etag;
389388
}
390389

391390
/**
@@ -447,17 +446,17 @@ public boolean equals(Object obj) {
447446

448447
BucketAccessControl toBucketPb() {
449448
BucketAccessControl bucketPb = new BucketAccessControl();
450-
bucketPb.setRole(role().toString());
451449
bucketPb.setEntity(entity().toString());
450+
bucketPb.setRole(role().toString());
452451
bucketPb.setId(id());
453452
bucketPb.setEtag(etag());
454453
return bucketPb;
455454
}
456455

457456
ObjectAccessControl toObjectPb() {
458457
ObjectAccessControl objectPb = new ObjectAccessControl();
459-
objectPb.setRole(role().name());
460458
objectPb.setEntity(entity().toPb());
459+
objectPb.setRole(role().name());
461460
objectPb.setId(id());
462461
objectPb.setEtag(etag());
463462
return objectPb;

0 commit comments

Comments
 (0)