/* * Copyright 2018-2023 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* Minimum object size to which the rule applies. *
*/ private Long objectSizeGreaterThan; /** ** Maximum object size to which the rule applies. *
*/ 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* 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* 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* 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* Minimum object size to which the rule applies. *
* * @param objectSizeGreaterThan * Minimum object size to which the rule applies. */ public void setObjectSizeGreaterThan(Long objectSizeGreaterThan) { this.objectSizeGreaterThan = objectSizeGreaterThan; } /** ** Minimum object size to which the rule applies. *
* * @return Minimum object size to which the rule applies. */ public Long getObjectSizeGreaterThan() { return this.objectSizeGreaterThan; } /** ** Minimum object size to which the rule applies. *
* * @param objectSizeGreaterThan * Minimum object size to which the rule applies. * @return Returns a reference to this object so that method calls can be chained together. */ public LifecycleRuleAndOperator withObjectSizeGreaterThan(Long objectSizeGreaterThan) { setObjectSizeGreaterThan(objectSizeGreaterThan); return this; } /** ** Maximum object size to which the rule applies. *
* * @param objectSizeLessThan * Maximum object size to which the rule applies. */ public void setObjectSizeLessThan(Long objectSizeLessThan) { this.objectSizeLessThan = objectSizeLessThan; } /** ** Maximum object size to which the rule applies. *
* * @return Maximum object size to which the rule applies. */ public Long getObjectSizeLessThan() { return this.objectSizeLessThan; } /** ** Maximum object size to which the rule applies. *
* * @param objectSizeLessThan * Maximum object size to which the rule applies. * @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); } } }