com.amazonaws.services.workmail.model.FolderConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-workmail 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.workmail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The configuration applied to an organization's folders by its retention policy.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FolderConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The folder name.
*
*/
private String name;
/**
*
* The action to take on the folder contents at the end of the folder configuration period.
*
*/
private String action;
/**
*
* The number of days for which the folder-configuration action applies.
*
*/
private Integer period;
/**
*
* The folder name.
*
*
* @param name
* The folder name.
* @see FolderName
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The folder name.
*
*
* @return The folder name.
* @see FolderName
*/
public String getName() {
return this.name;
}
/**
*
* The folder name.
*
*
* @param name
* The folder name.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FolderName
*/
public FolderConfiguration withName(String name) {
setName(name);
return this;
}
/**
*
* The folder name.
*
*
* @param name
* The folder name.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FolderName
*/
public FolderConfiguration withName(FolderName name) {
this.name = name.toString();
return this;
}
/**
*
* The action to take on the folder contents at the end of the folder configuration period.
*
*
* @param action
* The action to take on the folder contents at the end of the folder configuration period.
* @see RetentionAction
*/
public void setAction(String action) {
this.action = action;
}
/**
*
* The action to take on the folder contents at the end of the folder configuration period.
*
*
* @return The action to take on the folder contents at the end of the folder configuration period.
* @see RetentionAction
*/
public String getAction() {
return this.action;
}
/**
*
* The action to take on the folder contents at the end of the folder configuration period.
*
*
* @param action
* The action to take on the folder contents at the end of the folder configuration period.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RetentionAction
*/
public FolderConfiguration withAction(String action) {
setAction(action);
return this;
}
/**
*
* The action to take on the folder contents at the end of the folder configuration period.
*
*
* @param action
* The action to take on the folder contents at the end of the folder configuration period.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RetentionAction
*/
public FolderConfiguration withAction(RetentionAction action) {
this.action = action.toString();
return this;
}
/**
*
* The number of days for which the folder-configuration action applies.
*
*
* @param period
* The number of days for which the folder-configuration action applies.
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
*
* The number of days for which the folder-configuration action applies.
*
*
* @return The number of days for which the folder-configuration action applies.
*/
public Integer getPeriod() {
return this.period;
}
/**
*
* The number of days for which the folder-configuration action applies.
*
*
* @param period
* The number of days for which the folder-configuration action applies.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FolderConfiguration withPeriod(Integer period) {
setPeriod(period);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getAction() != null)
sb.append("Action: ").append(getAction()).append(",");
if (getPeriod() != null)
sb.append("Period: ").append(getPeriod());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FolderConfiguration == false)
return false;
FolderConfiguration other = (FolderConfiguration) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getAction() == null ^ this.getAction() == null)
return false;
if (other.getAction() != null && other.getAction().equals(this.getAction()) == false)
return false;
if (other.getPeriod() == null ^ this.getPeriod() == null)
return false;
if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode());
hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
return hashCode;
}
@Override
public FolderConfiguration clone() {
try {
return (FolderConfiguration) 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.workmail.model.transform.FolderConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}