com.amazonaws.services.s3control.model.S3AccessControlList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-s3control Show documentation
Show all versions of aws-java-sdk-s3control Show documentation
The AWS Java SDK for AWS S3 Control module holds the client classes that are used for communicating with AWS S3 Control Service
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.s3control.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class S3AccessControlList implements Serializable, Cloneable {
/** */
private S3ObjectOwner owner;
/** */
private java.util.List grants;
/**
*
*
* @param owner
*/
public void setOwner(S3ObjectOwner owner) {
this.owner = owner;
}
/**
*
*
* @return
*/
public S3ObjectOwner getOwner() {
return this.owner;
}
/**
*
*
* @param owner
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3AccessControlList withOwner(S3ObjectOwner owner) {
setOwner(owner);
return this;
}
/**
*
*
* @return
*/
public java.util.List getGrants() {
return grants;
}
/**
*
*
* @param grants
*/
public void setGrants(java.util.Collection grants) {
if (grants == null) {
this.grants = null;
return;
}
this.grants = new java.util.ArrayList(grants);
}
/**
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGrants(java.util.Collection)} or {@link #withGrants(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param grants
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3AccessControlList withGrants(S3Grant... grants) {
if (this.grants == null) {
setGrants(new java.util.ArrayList(grants.length));
}
for (S3Grant ele : grants) {
this.grants.add(ele);
}
return this;
}
/**
*
*
* @param grants
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3AccessControlList withGrants(java.util.Collection grants) {
setGrants(grants);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getOwner() != null)
sb.append("Owner: ").append(getOwner()).append(",");
if (getGrants() != null)
sb.append("Grants: ").append(getGrants());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof S3AccessControlList == false)
return false;
S3AccessControlList other = (S3AccessControlList) obj;
if (other.getOwner() == null ^ this.getOwner() == null)
return false;
if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false)
return false;
if (other.getGrants() == null ^ this.getGrants() == null)
return false;
if (other.getGrants() != null && other.getGrants().equals(this.getGrants()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode());
hashCode = prime * hashCode + ((getGrants() == null) ? 0 : getGrants().hashCode());
return hashCode;
}
@Override
public S3AccessControlList clone() {
try {
return (S3AccessControlList) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy