All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.backup.model.BackupPlan Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Backup module holds the client classes that are used for communicating with AWS Backup Service

There is a newer version: 1.12.780
Show newest version
/*
 * 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;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Contains an optional backup plan display name and an array of BackupRule objects, each of which * specifies a backup rule. Each rule in a backup plan is a separate scheduled task and can back up a different * selection of Amazon Web Services resources. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BackupPlan implements Serializable, Cloneable, StructuredPojo { /** *

* The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. *

*/ private String backupPlanName; /** *

* An array of BackupRule objects, each of which specifies a scheduled task that is used to back up a * selection of resources. *

*/ private java.util.List rules; /** *

* Contains a list of BackupOptions for each resource type. *

*/ private java.util.List advancedBackupSettings; /** *

* The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. *

* * @param backupPlanName * The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. */ public void setBackupPlanName(String backupPlanName) { this.backupPlanName = backupPlanName; } /** *

* The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. *

* * @return The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. */ public String getBackupPlanName() { return this.backupPlanName; } /** *

* The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. *

* * @param backupPlanName * The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters. * @return Returns a reference to this object so that method calls can be chained together. */ public BackupPlan withBackupPlanName(String backupPlanName) { setBackupPlanName(backupPlanName); return this; } /** *

* An array of BackupRule objects, each of which specifies a scheduled task that is used to back up a * selection of resources. *

* * @return An array of BackupRule objects, each of which specifies a scheduled task that is used to * back up a selection of resources. */ public java.util.List getRules() { return rules; } /** *

* An array of BackupRule objects, each of which specifies a scheduled task that is used to back up a * selection of resources. *

* * @param rules * An array of BackupRule objects, each of which specifies a scheduled task that is used to back * up a selection of resources. */ public void setRules(java.util.Collection rules) { if (rules == null) { this.rules = null; return; } this.rules = new java.util.ArrayList(rules); } /** *

* An array of BackupRule objects, each of which specifies a scheduled task that is used to back up a * selection of resources. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setRules(java.util.Collection)} or {@link #withRules(java.util.Collection)} if you want to override the * existing values. *

* * @param rules * An array of BackupRule objects, each of which specifies a scheduled task that is used to back * up a selection of resources. * @return Returns a reference to this object so that method calls can be chained together. */ public BackupPlan withRules(BackupRule... rules) { if (this.rules == null) { setRules(new java.util.ArrayList(rules.length)); } for (BackupRule ele : rules) { this.rules.add(ele); } return this; } /** *

* An array of BackupRule objects, each of which specifies a scheduled task that is used to back up a * selection of resources. *

* * @param rules * An array of BackupRule objects, each of which specifies a scheduled task that is used to back * up a selection of resources. * @return Returns a reference to this object so that method calls can be chained together. */ public BackupPlan withRules(java.util.Collection rules) { setRules(rules); return this; } /** *

* Contains a list of BackupOptions for each resource type. *

* * @return Contains a list of BackupOptions for each resource type. */ public java.util.List getAdvancedBackupSettings() { return advancedBackupSettings; } /** *

* Contains a list of BackupOptions for each resource type. *

* * @param advancedBackupSettings * Contains a list of BackupOptions for each resource type. */ public void setAdvancedBackupSettings(java.util.Collection advancedBackupSettings) { if (advancedBackupSettings == null) { this.advancedBackupSettings = null; return; } this.advancedBackupSettings = new java.util.ArrayList(advancedBackupSettings); } /** *

* Contains a list of BackupOptions for each resource type. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setAdvancedBackupSettings(java.util.Collection)} or * {@link #withAdvancedBackupSettings(java.util.Collection)} if you want to override the existing values. *

* * @param advancedBackupSettings * Contains a list of BackupOptions for each resource type. * @return Returns a reference to this object so that method calls can be chained together. */ public BackupPlan withAdvancedBackupSettings(AdvancedBackupSetting... advancedBackupSettings) { if (this.advancedBackupSettings == null) { setAdvancedBackupSettings(new java.util.ArrayList(advancedBackupSettings.length)); } for (AdvancedBackupSetting ele : advancedBackupSettings) { this.advancedBackupSettings.add(ele); } return this; } /** *

* Contains a list of BackupOptions for each resource type. *

* * @param advancedBackupSettings * Contains a list of BackupOptions for each resource type. * @return Returns a reference to this object so that method calls can be chained together. */ public BackupPlan withAdvancedBackupSettings(java.util.Collection advancedBackupSettings) { setAdvancedBackupSettings(advancedBackupSettings); 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 (getBackupPlanName() != null) sb.append("BackupPlanName: ").append(getBackupPlanName()).append(","); if (getRules() != null) sb.append("Rules: ").append(getRules()).append(","); if (getAdvancedBackupSettings() != null) sb.append("AdvancedBackupSettings: ").append(getAdvancedBackupSettings()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BackupPlan == false) return false; BackupPlan other = (BackupPlan) obj; if (other.getBackupPlanName() == null ^ this.getBackupPlanName() == null) return false; if (other.getBackupPlanName() != null && other.getBackupPlanName().equals(this.getBackupPlanName()) == false) return false; if (other.getRules() == null ^ this.getRules() == null) return false; if (other.getRules() != null && other.getRules().equals(this.getRules()) == false) return false; if (other.getAdvancedBackupSettings() == null ^ this.getAdvancedBackupSettings() == null) return false; if (other.getAdvancedBackupSettings() != null && other.getAdvancedBackupSettings().equals(this.getAdvancedBackupSettings()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBackupPlanName() == null) ? 0 : getBackupPlanName().hashCode()); hashCode = prime * hashCode + ((getRules() == null) ? 0 : getRules().hashCode()); hashCode = prime * hashCode + ((getAdvancedBackupSettings() == null) ? 0 : getAdvancedBackupSettings().hashCode()); return hashCode; } @Override public BackupPlan clone() { try { return (BackupPlan) 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.backup.model.transform.BackupPlanMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy