com.amazonaws.services.s3.model.RestoreStatus Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-s3 Show documentation
Show all versions of aws-java-sdk-s3 Show documentation
The AWS Java SDK for Amazon S3 module holds the client classes that are used for communicating with Amazon Simple Storage Service
The newest version!
/*
* Copyright 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.s3.model;
import java.io.Serializable;
import java.util.Date;
/**
*
* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be
* retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects
* in the Amazon S3 User Guide.
*
*/
public class RestoreStatus implements Serializable {
/**
* Specifies whether the object is currently being restored or not
*/
private Boolean isRestoreInProgress;
/**
* Indicates when the restored copy will expire. This value is only populated if the object has already been
* restored.
*/
private Date restoreExpiryDate;
/**
*
* Specifies whether the object is currently being restored. TRUE
indicates that the object is
* currently being restored. FALSE
indicates that the restoration process has either not started or is
* already complete.
*
*
* @return Specifies whether the object is currently being restored. TRUE
indicates that the object is
* currently being restored. FALSE
indicates that the restoration process has either not
* started or is already complete.
*/
public Boolean isRestoreInProgress() {
return isRestoreInProgress;
}
/**
* Sets the restore status of an object which specifies whether the object is currently being restored.
*
* @param isRestoreInProgress
* @return {@link RestoreStatus}
*/
public RestoreStatus withIsRestoreInProgress(Boolean isRestoreInProgress) {
this.isRestoreInProgress = isRestoreInProgress;
return this;
}
/**
* Sets the restore status of an object which specifies whether the object is currently being restored.
*
* @param isRestoreInProgress
*/
public void setIsRestoreInProgress(Boolean isRestoreInProgress) {
withIsRestoreInProgress(isRestoreInProgress);
}
/**
*
* Indicates when the restored copy will expire. This value is only populated if the object has already been
* restored.
*
*
* @return Indicates when the restored copy will expire. This value is only populated if the object has already been
* restored.
*/
public Date getRestoreExpiryDate() {
return restoreExpiryDate;
}
/**
* Sets the restore expiry date of an object. This value is only populated if the object has already been
* restored.
*
* @param restoreExpiryDate
* @return {@link RestoreStatus}
*/
public RestoreStatus withRestoreExpiryDate(Date restoreExpiryDate) {
this.restoreExpiryDate = restoreExpiryDate;
return this;
}
/**
* Sets the restore expiry date of an object. This value is only populated if the object has already been
* restored.
*
* @param restoreExpiryDate
*/
public void setRestoreExpiryDate(Date restoreExpiryDate) {
withRestoreExpiryDate(restoreExpiryDate);
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
* @see Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRestoreExpiryDate() != null) {
sb.append("RestoreExpiryDate: ").append(getRestoreExpiryDate()).append(", ");
}
if (isRestoreInProgress() != null) {
sb.append("RestoreInProgress: ").append(isRestoreInProgress()).append(", ");
}
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (obj instanceof RestoreStatus == false) {
return false;
}
RestoreStatus other = (RestoreStatus) obj;
if (other.getRestoreExpiryDate() == null ^ this.getRestoreExpiryDate() == null) {
return false;
}
if (other.isRestoreInProgress() == null ^ this.isRestoreInProgress() == null) {
return false;
}
if (other.getRestoreExpiryDate() != null &&
other.getRestoreExpiryDate().equals(this.getRestoreExpiryDate()) == false) {
return false;
}
if (other.isRestoreInProgress() != null &&
other.isRestoreInProgress().equals(this.isRestoreInProgress()) == false) {
return false;
}
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRestoreExpiryDate() == null) ? 0 : getRestoreExpiryDate().hashCode());
hashCode = prime * hashCode + ((isRestoreInProgress() == null) ? 0 : isRestoreInProgress().hashCode());
return hashCode;
}
@Override
public RestoreStatus clone() {
try {
return (RestoreStatus) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy