com.amazonaws.services.s3control.model.LifecycleRuleAndOperator Maven / Gradle / Ivy
Show all versions of aws-java-sdk-s3control Show documentation
/*
* Copyright 2019-2024 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;
/**
*
* The container for the Outposts bucket lifecycle rule and operator.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LifecycleRuleAndOperator implements Serializable, Cloneable {
/**
*
* Prefix identifying one or more objects to which the rule applies.
*
*/
private String prefix;
/**
*
* All of these tags must exist in the object's tag set in order for the rule to apply.
*
*/
private java.util.List tags;
/**
*
* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule applies
* to objects with a size that is greater than 7.
*
*/
private Long objectSizeGreaterThan;
/**
*
* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule applies
* to objects with a size that is less than 77.
*
*/
private Long objectSizeLessThan;
/**
*
* Prefix identifying one or more objects to which the rule applies.
*
*
* @param prefix
* Prefix identifying one or more objects to which the rule applies.
*/
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
*
* Prefix identifying one or more objects to which the rule applies.
*
*
* @return Prefix identifying one or more objects to which the rule applies.
*/
public String getPrefix() {
return this.prefix;
}
/**
*
* Prefix identifying one or more objects to which the rule applies.
*
*
* @param prefix
* Prefix identifying one or more objects to which the rule applies.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleRuleAndOperator withPrefix(String prefix) {
setPrefix(prefix);
return this;
}
/**
*
* All of these tags must exist in the object's tag set in order for the rule to apply.
*
*
* @return All of these tags must exist in the object's tag set in order for the rule to apply.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* All of these tags must exist in the object's tag set in order for the rule to apply.
*
*
* @param tags
* All of these tags must exist in the object's tag set in order for the rule to apply.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* All of these tags must exist in the object's tag set in order for the rule to apply.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* All of these tags must exist in the object's tag set in order for the rule to apply.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleRuleAndOperator withTags(S3Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (S3Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* All of these tags must exist in the object's tag set in order for the rule to apply.
*
*
* @param tags
* All of these tags must exist in the object's tag set in order for the rule to apply.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleRuleAndOperator withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule applies
* to objects with a size that is greater than 7.
*
*
* @param objectSizeGreaterThan
* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule
* applies to objects with a size that is greater than 7.
*/
public void setObjectSizeGreaterThan(Long objectSizeGreaterThan) {
this.objectSizeGreaterThan = objectSizeGreaterThan;
}
/**
*
* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule applies
* to objects with a size that is greater than 7.
*
*
* @return The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule
* applies to objects with a size that is greater than 7.
*/
public Long getObjectSizeGreaterThan() {
return this.objectSizeGreaterThan;
}
/**
*
* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule applies
* to objects with a size that is greater than 7.
*
*
* @param objectSizeGreaterThan
* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule
* applies to objects with a size that is greater than 7.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleRuleAndOperator withObjectSizeGreaterThan(Long objectSizeGreaterThan) {
setObjectSizeGreaterThan(objectSizeGreaterThan);
return this;
}
/**
*
* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule applies
* to objects with a size that is less than 77.
*
*
* @param objectSizeLessThan
* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule
* applies to objects with a size that is less than 77.
*/
public void setObjectSizeLessThan(Long objectSizeLessThan) {
this.objectSizeLessThan = objectSizeLessThan;
}
/**
*
* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule applies
* to objects with a size that is less than 77.
*
*
* @return The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule
* applies to objects with a size that is less than 77.
*/
public Long getObjectSizeLessThan() {
return this.objectSizeLessThan;
}
/**
*
* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule applies
* to objects with a size that is less than 77.
*
*
* @param objectSizeLessThan
* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule
* applies to objects with a size that is less than 77.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleRuleAndOperator withObjectSizeLessThan(Long objectSizeLessThan) {
setObjectSizeLessThan(objectSizeLessThan);
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 (getPrefix() != null)
sb.append("Prefix: ").append(getPrefix()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getObjectSizeGreaterThan() != null)
sb.append("ObjectSizeGreaterThan: ").append(getObjectSizeGreaterThan()).append(",");
if (getObjectSizeLessThan() != null)
sb.append("ObjectSizeLessThan: ").append(getObjectSizeLessThan());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LifecycleRuleAndOperator == false)
return false;
LifecycleRuleAndOperator other = (LifecycleRuleAndOperator) obj;
if (other.getPrefix() == null ^ this.getPrefix() == null)
return false;
if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getObjectSizeGreaterThan() == null ^ this.getObjectSizeGreaterThan() == null)
return false;
if (other.getObjectSizeGreaterThan() != null && other.getObjectSizeGreaterThan().equals(this.getObjectSizeGreaterThan()) == false)
return false;
if (other.getObjectSizeLessThan() == null ^ this.getObjectSizeLessThan() == null)
return false;
if (other.getObjectSizeLessThan() != null && other.getObjectSizeLessThan().equals(this.getObjectSizeLessThan()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getObjectSizeGreaterThan() == null) ? 0 : getObjectSizeGreaterThan().hashCode());
hashCode = prime * hashCode + ((getObjectSizeLessThan() == null) ? 0 : getObjectSizeLessThan().hashCode());
return hashCode;
}
@Override
public LifecycleRuleAndOperator clone() {
try {
return (LifecycleRuleAndOperator) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}