com.amazonaws.services.opensearchserverless.model.BatchGetLifecyclePolicyResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-opensearchserverless 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.opensearchserverless.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BatchGetLifecyclePolicyResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* A list of lifecycle policies matched to the input policy name and policy type.
*
*/
private java.util.List lifecyclePolicyDetails;
/**
*
* A list of lifecycle policy names and policy types for which retrieval failed.
*
*/
private java.util.List lifecyclePolicyErrorDetails;
/**
*
* A list of lifecycle policies matched to the input policy name and policy type.
*
*
* @return A list of lifecycle policies matched to the input policy name and policy type.
*/
public java.util.List getLifecyclePolicyDetails() {
return lifecyclePolicyDetails;
}
/**
*
* A list of lifecycle policies matched to the input policy name and policy type.
*
*
* @param lifecyclePolicyDetails
* A list of lifecycle policies matched to the input policy name and policy type.
*/
public void setLifecyclePolicyDetails(java.util.Collection lifecyclePolicyDetails) {
if (lifecyclePolicyDetails == null) {
this.lifecyclePolicyDetails = null;
return;
}
this.lifecyclePolicyDetails = new java.util.ArrayList(lifecyclePolicyDetails);
}
/**
*
* A list of lifecycle policies matched to the input policy name and policy type.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLifecyclePolicyDetails(java.util.Collection)} or
* {@link #withLifecyclePolicyDetails(java.util.Collection)} if you want to override the existing values.
*
*
* @param lifecyclePolicyDetails
* A list of lifecycle policies matched to the input policy name and policy type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchGetLifecyclePolicyResult withLifecyclePolicyDetails(LifecyclePolicyDetail... lifecyclePolicyDetails) {
if (this.lifecyclePolicyDetails == null) {
setLifecyclePolicyDetails(new java.util.ArrayList(lifecyclePolicyDetails.length));
}
for (LifecyclePolicyDetail ele : lifecyclePolicyDetails) {
this.lifecyclePolicyDetails.add(ele);
}
return this;
}
/**
*
* A list of lifecycle policies matched to the input policy name and policy type.
*
*
* @param lifecyclePolicyDetails
* A list of lifecycle policies matched to the input policy name and policy type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchGetLifecyclePolicyResult withLifecyclePolicyDetails(java.util.Collection lifecyclePolicyDetails) {
setLifecyclePolicyDetails(lifecyclePolicyDetails);
return this;
}
/**
*
* A list of lifecycle policy names and policy types for which retrieval failed.
*
*
* @return A list of lifecycle policy names and policy types for which retrieval failed.
*/
public java.util.List getLifecyclePolicyErrorDetails() {
return lifecyclePolicyErrorDetails;
}
/**
*
* A list of lifecycle policy names and policy types for which retrieval failed.
*
*
* @param lifecyclePolicyErrorDetails
* A list of lifecycle policy names and policy types for which retrieval failed.
*/
public void setLifecyclePolicyErrorDetails(java.util.Collection lifecyclePolicyErrorDetails) {
if (lifecyclePolicyErrorDetails == null) {
this.lifecyclePolicyErrorDetails = null;
return;
}
this.lifecyclePolicyErrorDetails = new java.util.ArrayList(lifecyclePolicyErrorDetails);
}
/**
*
* A list of lifecycle policy names and policy types for which retrieval failed.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLifecyclePolicyErrorDetails(java.util.Collection)} or
* {@link #withLifecyclePolicyErrorDetails(java.util.Collection)} if you want to override the existing values.
*
*
* @param lifecyclePolicyErrorDetails
* A list of lifecycle policy names and policy types for which retrieval failed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchGetLifecyclePolicyResult withLifecyclePolicyErrorDetails(LifecyclePolicyErrorDetail... lifecyclePolicyErrorDetails) {
if (this.lifecyclePolicyErrorDetails == null) {
setLifecyclePolicyErrorDetails(new java.util.ArrayList(lifecyclePolicyErrorDetails.length));
}
for (LifecyclePolicyErrorDetail ele : lifecyclePolicyErrorDetails) {
this.lifecyclePolicyErrorDetails.add(ele);
}
return this;
}
/**
*
* A list of lifecycle policy names and policy types for which retrieval failed.
*
*
* @param lifecyclePolicyErrorDetails
* A list of lifecycle policy names and policy types for which retrieval failed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchGetLifecyclePolicyResult withLifecyclePolicyErrorDetails(java.util.Collection lifecyclePolicyErrorDetails) {
setLifecyclePolicyErrorDetails(lifecyclePolicyErrorDetails);
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 (getLifecyclePolicyDetails() != null)
sb.append("LifecyclePolicyDetails: ").append(getLifecyclePolicyDetails()).append(",");
if (getLifecyclePolicyErrorDetails() != null)
sb.append("LifecyclePolicyErrorDetails: ").append(getLifecyclePolicyErrorDetails());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BatchGetLifecyclePolicyResult == false)
return false;
BatchGetLifecyclePolicyResult other = (BatchGetLifecyclePolicyResult) obj;
if (other.getLifecyclePolicyDetails() == null ^ this.getLifecyclePolicyDetails() == null)
return false;
if (other.getLifecyclePolicyDetails() != null && other.getLifecyclePolicyDetails().equals(this.getLifecyclePolicyDetails()) == false)
return false;
if (other.getLifecyclePolicyErrorDetails() == null ^ this.getLifecyclePolicyErrorDetails() == null)
return false;
if (other.getLifecyclePolicyErrorDetails() != null && other.getLifecyclePolicyErrorDetails().equals(this.getLifecyclePolicyErrorDetails()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLifecyclePolicyDetails() == null) ? 0 : getLifecyclePolicyDetails().hashCode());
hashCode = prime * hashCode + ((getLifecyclePolicyErrorDetails() == null) ? 0 : getLifecyclePolicyErrorDetails().hashCode());
return hashCode;
}
@Override
public BatchGetLifecyclePolicyResult clone() {
try {
return (BatchGetLifecyclePolicyResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}