com.amazonaws.services.backup.model.GetLegalHoldResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-backup 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.backup.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetLegalHoldResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* This is the string title of the legal hold.
*
*/
private String title;
/**
*
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
*
*/
private String status;
/**
*
* This is the returned string description of the legal hold.
*
*/
private String description;
/**
*
* String describing the reason for removing the legal hold.
*
*/
private String cancelDescription;
/**
*
* This is the returned ID associated with a specified legal hold.
*
*/
private String legalHoldId;
/**
*
* This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
*
*/
private String legalHoldArn;
/**
*
* Time in number format when legal hold was created.
*
*/
private java.util.Date creationDate;
/**
*
* Time in number when legal hold was cancelled.
*
*/
private java.util.Date cancellationDate;
/**
*
* This is the date and time until which the legal hold record will be retained.
*
*/
private java.util.Date retainRecordUntil;
/**
*
* This specifies criteria to assign a set of resources, such as resource types or backup vaults.
*
*/
private RecoveryPointSelection recoveryPointSelection;
/**
*
* This is the string title of the legal hold.
*
*
* @param title
* This is the string title of the legal hold.
*/
public void setTitle(String title) {
this.title = title;
}
/**
*
* This is the string title of the legal hold.
*
*
* @return This is the string title of the legal hold.
*/
public String getTitle() {
return this.title;
}
/**
*
* This is the string title of the legal hold.
*
*
* @param title
* This is the string title of the legal hold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withTitle(String title) {
setTitle(title);
return this;
}
/**
*
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
*
*
* @param status
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
* @see LegalHoldStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
*
*
* @return This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
* @see LegalHoldStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
*
*
* @param status
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LegalHoldStatus
*/
public GetLegalHoldResult withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
*
*
* @param status
* This is the status of the legal hold. Statuses can be ACTIVE
, CREATING
,
* CANCELED
, and CANCELING
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LegalHoldStatus
*/
public GetLegalHoldResult withStatus(LegalHoldStatus status) {
this.status = status.toString();
return this;
}
/**
*
* This is the returned string description of the legal hold.
*
*
* @param description
* This is the returned string description of the legal hold.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* This is the returned string description of the legal hold.
*
*
* @return This is the returned string description of the legal hold.
*/
public String getDescription() {
return this.description;
}
/**
*
* This is the returned string description of the legal hold.
*
*
* @param description
* This is the returned string description of the legal hold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* String describing the reason for removing the legal hold.
*
*
* @param cancelDescription
* String describing the reason for removing the legal hold.
*/
public void setCancelDescription(String cancelDescription) {
this.cancelDescription = cancelDescription;
}
/**
*
* String describing the reason for removing the legal hold.
*
*
* @return String describing the reason for removing the legal hold.
*/
public String getCancelDescription() {
return this.cancelDescription;
}
/**
*
* String describing the reason for removing the legal hold.
*
*
* @param cancelDescription
* String describing the reason for removing the legal hold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withCancelDescription(String cancelDescription) {
setCancelDescription(cancelDescription);
return this;
}
/**
*
* This is the returned ID associated with a specified legal hold.
*
*
* @param legalHoldId
* This is the returned ID associated with a specified legal hold.
*/
public void setLegalHoldId(String legalHoldId) {
this.legalHoldId = legalHoldId;
}
/**
*
* This is the returned ID associated with a specified legal hold.
*
*
* @return This is the returned ID associated with a specified legal hold.
*/
public String getLegalHoldId() {
return this.legalHoldId;
}
/**
*
* This is the returned ID associated with a specified legal hold.
*
*
* @param legalHoldId
* This is the returned ID associated with a specified legal hold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withLegalHoldId(String legalHoldId) {
setLegalHoldId(legalHoldId);
return this;
}
/**
*
* This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
*
*
* @param legalHoldArn
* This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
*/
public void setLegalHoldArn(String legalHoldArn) {
this.legalHoldArn = legalHoldArn;
}
/**
*
* This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
*
*
* @return This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
*/
public String getLegalHoldArn() {
return this.legalHoldArn;
}
/**
*
* This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
*
*
* @param legalHoldArn
* This is the returned framework ARN for the specified legal hold. An Amazon Resource Name (ARN) uniquely
* identifies a resource. The format of the ARN depends on the resource type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withLegalHoldArn(String legalHoldArn) {
setLegalHoldArn(legalHoldArn);
return this;
}
/**
*
* Time in number format when legal hold was created.
*
*
* @param creationDate
* Time in number format when legal hold was created.
*/
public void setCreationDate(java.util.Date creationDate) {
this.creationDate = creationDate;
}
/**
*
* Time in number format when legal hold was created.
*
*
* @return Time in number format when legal hold was created.
*/
public java.util.Date getCreationDate() {
return this.creationDate;
}
/**
*
* Time in number format when legal hold was created.
*
*
* @param creationDate
* Time in number format when legal hold was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withCreationDate(java.util.Date creationDate) {
setCreationDate(creationDate);
return this;
}
/**
*
* Time in number when legal hold was cancelled.
*
*
* @param cancellationDate
* Time in number when legal hold was cancelled.
*/
public void setCancellationDate(java.util.Date cancellationDate) {
this.cancellationDate = cancellationDate;
}
/**
*
* Time in number when legal hold was cancelled.
*
*
* @return Time in number when legal hold was cancelled.
*/
public java.util.Date getCancellationDate() {
return this.cancellationDate;
}
/**
*
* Time in number when legal hold was cancelled.
*
*
* @param cancellationDate
* Time in number when legal hold was cancelled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withCancellationDate(java.util.Date cancellationDate) {
setCancellationDate(cancellationDate);
return this;
}
/**
*
* This is the date and time until which the legal hold record will be retained.
*
*
* @param retainRecordUntil
* This is the date and time until which the legal hold record will be retained.
*/
public void setRetainRecordUntil(java.util.Date retainRecordUntil) {
this.retainRecordUntil = retainRecordUntil;
}
/**
*
* This is the date and time until which the legal hold record will be retained.
*
*
* @return This is the date and time until which the legal hold record will be retained.
*/
public java.util.Date getRetainRecordUntil() {
return this.retainRecordUntil;
}
/**
*
* This is the date and time until which the legal hold record will be retained.
*
*
* @param retainRecordUntil
* This is the date and time until which the legal hold record will be retained.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withRetainRecordUntil(java.util.Date retainRecordUntil) {
setRetainRecordUntil(retainRecordUntil);
return this;
}
/**
*
* This specifies criteria to assign a set of resources, such as resource types or backup vaults.
*
*
* @param recoveryPointSelection
* This specifies criteria to assign a set of resources, such as resource types or backup vaults.
*/
public void setRecoveryPointSelection(RecoveryPointSelection recoveryPointSelection) {
this.recoveryPointSelection = recoveryPointSelection;
}
/**
*
* This specifies criteria to assign a set of resources, such as resource types or backup vaults.
*
*
* @return This specifies criteria to assign a set of resources, such as resource types or backup vaults.
*/
public RecoveryPointSelection getRecoveryPointSelection() {
return this.recoveryPointSelection;
}
/**
*
* This specifies criteria to assign a set of resources, such as resource types or backup vaults.
*
*
* @param recoveryPointSelection
* This specifies criteria to assign a set of resources, such as resource types or backup vaults.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetLegalHoldResult withRecoveryPointSelection(RecoveryPointSelection recoveryPointSelection) {
setRecoveryPointSelection(recoveryPointSelection);
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 (getTitle() != null)
sb.append("Title: ").append(getTitle()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getCancelDescription() != null)
sb.append("CancelDescription: ").append(getCancelDescription()).append(",");
if (getLegalHoldId() != null)
sb.append("LegalHoldId: ").append(getLegalHoldId()).append(",");
if (getLegalHoldArn() != null)
sb.append("LegalHoldArn: ").append(getLegalHoldArn()).append(",");
if (getCreationDate() != null)
sb.append("CreationDate: ").append(getCreationDate()).append(",");
if (getCancellationDate() != null)
sb.append("CancellationDate: ").append(getCancellationDate()).append(",");
if (getRetainRecordUntil() != null)
sb.append("RetainRecordUntil: ").append(getRetainRecordUntil()).append(",");
if (getRecoveryPointSelection() != null)
sb.append("RecoveryPointSelection: ").append(getRecoveryPointSelection());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetLegalHoldResult == false)
return false;
GetLegalHoldResult other = (GetLegalHoldResult) obj;
if (other.getTitle() == null ^ this.getTitle() == null)
return false;
if (other.getTitle() != null && other.getTitle().equals(this.getTitle()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getCancelDescription() == null ^ this.getCancelDescription() == null)
return false;
if (other.getCancelDescription() != null && other.getCancelDescription().equals(this.getCancelDescription()) == false)
return false;
if (other.getLegalHoldId() == null ^ this.getLegalHoldId() == null)
return false;
if (other.getLegalHoldId() != null && other.getLegalHoldId().equals(this.getLegalHoldId()) == false)
return false;
if (other.getLegalHoldArn() == null ^ this.getLegalHoldArn() == null)
return false;
if (other.getLegalHoldArn() != null && other.getLegalHoldArn().equals(this.getLegalHoldArn()) == false)
return false;
if (other.getCreationDate() == null ^ this.getCreationDate() == null)
return false;
if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false)
return false;
if (other.getCancellationDate() == null ^ this.getCancellationDate() == null)
return false;
if (other.getCancellationDate() != null && other.getCancellationDate().equals(this.getCancellationDate()) == false)
return false;
if (other.getRetainRecordUntil() == null ^ this.getRetainRecordUntil() == null)
return false;
if (other.getRetainRecordUntil() != null && other.getRetainRecordUntil().equals(this.getRetainRecordUntil()) == false)
return false;
if (other.getRecoveryPointSelection() == null ^ this.getRecoveryPointSelection() == null)
return false;
if (other.getRecoveryPointSelection() != null && other.getRecoveryPointSelection().equals(this.getRecoveryPointSelection()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTitle() == null) ? 0 : getTitle().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getCancelDescription() == null) ? 0 : getCancelDescription().hashCode());
hashCode = prime * hashCode + ((getLegalHoldId() == null) ? 0 : getLegalHoldId().hashCode());
hashCode = prime * hashCode + ((getLegalHoldArn() == null) ? 0 : getLegalHoldArn().hashCode());
hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode());
hashCode = prime * hashCode + ((getCancellationDate() == null) ? 0 : getCancellationDate().hashCode());
hashCode = prime * hashCode + ((getRetainRecordUntil() == null) ? 0 : getRetainRecordUntil().hashCode());
hashCode = prime * hashCode + ((getRecoveryPointSelection() == null) ? 0 : getRecoveryPointSelection().hashCode());
return hashCode;
}
@Override
public GetLegalHoldResult clone() {
try {
return (GetLegalHoldResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}