com.amazonaws.services.recyclebin.model.UnlockDelay Maven / Gradle / Ivy
Show all versions of aws-java-sdk-recyclebin 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.recyclebin.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about the retention rule unlock delay. The unlock delay is the period after which a retention rule can be
* modified or edited after it has been unlocked by a user with the required permissions. The retention rule can't be
* modified or deleted during the unlock delay.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UnlockDelay implements Serializable, Cloneable, StructuredPojo {
/**
*
* The unlock delay period, measured in the unit specified for UnlockDelayUnit.
*
*/
private Integer unlockDelayValue;
/**
*
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
*
*/
private String unlockDelayUnit;
/**
*
* The unlock delay period, measured in the unit specified for UnlockDelayUnit.
*
*
* @param unlockDelayValue
* The unlock delay period, measured in the unit specified for UnlockDelayUnit.
*/
public void setUnlockDelayValue(Integer unlockDelayValue) {
this.unlockDelayValue = unlockDelayValue;
}
/**
*
* The unlock delay period, measured in the unit specified for UnlockDelayUnit.
*
*
* @return The unlock delay period, measured in the unit specified for UnlockDelayUnit.
*/
public Integer getUnlockDelayValue() {
return this.unlockDelayValue;
}
/**
*
* The unlock delay period, measured in the unit specified for UnlockDelayUnit.
*
*
* @param unlockDelayValue
* The unlock delay period, measured in the unit specified for UnlockDelayUnit.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UnlockDelay withUnlockDelayValue(Integer unlockDelayValue) {
setUnlockDelayValue(unlockDelayValue);
return this;
}
/**
*
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
*
*
* @param unlockDelayUnit
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in
* days.
* @see UnlockDelayUnit
*/
public void setUnlockDelayUnit(String unlockDelayUnit) {
this.unlockDelayUnit = unlockDelayUnit;
}
/**
*
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
*
*
* @return The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in
* days.
* @see UnlockDelayUnit
*/
public String getUnlockDelayUnit() {
return this.unlockDelayUnit;
}
/**
*
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
*
*
* @param unlockDelayUnit
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in
* days.
* @return Returns a reference to this object so that method calls can be chained together.
* @see UnlockDelayUnit
*/
public UnlockDelay withUnlockDelayUnit(String unlockDelayUnit) {
setUnlockDelayUnit(unlockDelayUnit);
return this;
}
/**
*
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in days.
*
*
* @param unlockDelayUnit
* The unit of time in which to measure the unlock delay. Currently, the unlock delay can be measure only in
* days.
* @return Returns a reference to this object so that method calls can be chained together.
* @see UnlockDelayUnit
*/
public UnlockDelay withUnlockDelayUnit(UnlockDelayUnit unlockDelayUnit) {
this.unlockDelayUnit = unlockDelayUnit.toString();
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 (getUnlockDelayValue() != null)
sb.append("UnlockDelayValue: ").append(getUnlockDelayValue()).append(",");
if (getUnlockDelayUnit() != null)
sb.append("UnlockDelayUnit: ").append(getUnlockDelayUnit());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UnlockDelay == false)
return false;
UnlockDelay other = (UnlockDelay) obj;
if (other.getUnlockDelayValue() == null ^ this.getUnlockDelayValue() == null)
return false;
if (other.getUnlockDelayValue() != null && other.getUnlockDelayValue().equals(this.getUnlockDelayValue()) == false)
return false;
if (other.getUnlockDelayUnit() == null ^ this.getUnlockDelayUnit() == null)
return false;
if (other.getUnlockDelayUnit() != null && other.getUnlockDelayUnit().equals(this.getUnlockDelayUnit()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUnlockDelayValue() == null) ? 0 : getUnlockDelayValue().hashCode());
hashCode = prime * hashCode + ((getUnlockDelayUnit() == null) ? 0 : getUnlockDelayUnit().hashCode());
return hashCode;
}
@Override
public UnlockDelay clone() {
try {
return (UnlockDelay) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.recyclebin.model.transform.UnlockDelayMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}