Skip to content

Commit

Permalink
Consistently order fields in Acl, update serialVersionUID
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Sep 12, 2016
1 parent b0046d0 commit 5376eff
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
*/
public final class Acl implements Serializable {

private static final long serialVersionUID = 6435575339887912222L;

private static final long serialVersionUID = 7516713233557576082L;
static final Function<ObjectAccessControl, Acl> FROM_OBJECT_PB_FUNCTION =
new Function<ObjectAccessControl, Acl>() {
@Override
Expand All @@ -51,10 +50,10 @@ public Acl apply(BucketAccessControl aclPb) {
}
};

private final String id;
private final String etag;
private final Entity entity;
private final Role role;
private final String id;
private final String etag;

public enum Role {
OWNER, READER, WRITER
Expand Down Expand Up @@ -359,33 +358,33 @@ private Acl(Builder builder) {
}

/**
* Returns the ID of the ACL entry.
* Returns the entity for this ACL object.
*/
public String id() {
return id;
public Entity entity() {
return entity;
}

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

/**
* Returns the entity for this ACL object.
* Returns the ID of the ACL entry.
*/
public Entity entity() {
return entity;
public String id() {
return id;
}

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

/**
Expand Down Expand Up @@ -447,17 +446,17 @@ public boolean equals(Object obj) {

BucketAccessControl toBucketPb() {
BucketAccessControl bucketPb = new BucketAccessControl();
bucketPb.setRole(role().toString());
bucketPb.setEntity(entity().toString());
bucketPb.setRole(role().toString());
bucketPb.setId(id());
bucketPb.setEtag(etag());
return bucketPb;
}

ObjectAccessControl toObjectPb() {
ObjectAccessControl objectPb = new ObjectAccessControl();
objectPb.setRole(role().name());
objectPb.setEntity(entity().toPb());
objectPb.setRole(role().name());
objectPb.setId(id());
objectPb.setEtag(etag());
return objectPb;
Expand Down

0 comments on commit 5376eff

Please sign in to comment.