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

com.amazonaws.services.opsworks.model.Recipes Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.11.7
Show newest version
/*
 * Copyright 2011-2016 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.opsworks.model;

import java.io.Serializable;

/**
 * 

* AWS OpsWorks supports five lifecycle events: setup, * configuration, deploy, undeploy, and shutdown. * For each layer, AWS OpsWorks runs a set of standard recipes for each event. * In addition, you can provide custom recipes for any or all layers and events. * AWS OpsWorks runs custom event recipes after the standard recipes. * LayerCustomRecipes specifies the custom recipes for a particular * layer to be run in response to each of the five events. *

*

* To specify a recipe, use the cookbook's directory name in the repository * followed by two colons and the recipe name, which is the recipe's file name * without the .rb extension. For example: phpapp2::dbsetup specifies the * dbsetup.rb recipe in the repository's phpapp2 folder. *

*/ public class Recipes implements Serializable, Cloneable { /** *

* An array of custom recipe names to be run following a setup * event. *

*/ private com.amazonaws.internal.SdkInternalList setup; /** *

* An array of custom recipe names to be run following a * configure event. *

*/ private com.amazonaws.internal.SdkInternalList configure; /** *

* An array of custom recipe names to be run following a deploy * event. *

*/ private com.amazonaws.internal.SdkInternalList deploy; /** *

* An array of custom recipe names to be run following a * undeploy event. *

*/ private com.amazonaws.internal.SdkInternalList undeploy; /** *

* An array of custom recipe names to be run following a * shutdown event. *

*/ private com.amazonaws.internal.SdkInternalList shutdown; /** *

* An array of custom recipe names to be run following a setup * event. *

* * @return An array of custom recipe names to be run following a * setup event. */ public java.util.List getSetup() { if (setup == null) { setup = new com.amazonaws.internal.SdkInternalList(); } return setup; } /** *

* An array of custom recipe names to be run following a setup * event. *

* * @param setup * An array of custom recipe names to be run following a * setup event. */ public void setSetup(java.util.Collection setup) { if (setup == null) { this.setup = null; return; } this.setup = new com.amazonaws.internal.SdkInternalList(setup); } /** *

* An array of custom recipe names to be run following a setup * event. *

*

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

* * @param setup * An array of custom recipe names to be run following a * setup event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withSetup(String... setup) { if (this.setup == null) { setSetup(new com.amazonaws.internal.SdkInternalList( setup.length)); } for (String ele : setup) { this.setup.add(ele); } return this; } /** *

* An array of custom recipe names to be run following a setup * event. *

* * @param setup * An array of custom recipe names to be run following a * setup event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withSetup(java.util.Collection setup) { setSetup(setup); return this; } /** *

* An array of custom recipe names to be run following a * configure event. *

* * @return An array of custom recipe names to be run following a * configure event. */ public java.util.List getConfigure() { if (configure == null) { configure = new com.amazonaws.internal.SdkInternalList(); } return configure; } /** *

* An array of custom recipe names to be run following a * configure event. *

* * @param configure * An array of custom recipe names to be run following a * configure event. */ public void setConfigure(java.util.Collection configure) { if (configure == null) { this.configure = null; return; } this.configure = new com.amazonaws.internal.SdkInternalList( configure); } /** *

* An array of custom recipe names to be run following a * configure event. *

*

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

* * @param configure * An array of custom recipe names to be run following a * configure event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withConfigure(String... configure) { if (this.configure == null) { setConfigure(new com.amazonaws.internal.SdkInternalList( configure.length)); } for (String ele : configure) { this.configure.add(ele); } return this; } /** *

* An array of custom recipe names to be run following a * configure event. *

* * @param configure * An array of custom recipe names to be run following a * configure event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withConfigure(java.util.Collection configure) { setConfigure(configure); return this; } /** *

* An array of custom recipe names to be run following a deploy * event. *

* * @return An array of custom recipe names to be run following a * deploy event. */ public java.util.List getDeploy() { if (deploy == null) { deploy = new com.amazonaws.internal.SdkInternalList(); } return deploy; } /** *

* An array of custom recipe names to be run following a deploy * event. *

* * @param deploy * An array of custom recipe names to be run following a * deploy event. */ public void setDeploy(java.util.Collection deploy) { if (deploy == null) { this.deploy = null; return; } this.deploy = new com.amazonaws.internal.SdkInternalList(deploy); } /** *

* An array of custom recipe names to be run following a deploy * event. *

*

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

* * @param deploy * An array of custom recipe names to be run following a * deploy event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withDeploy(String... deploy) { if (this.deploy == null) { setDeploy(new com.amazonaws.internal.SdkInternalList( deploy.length)); } for (String ele : deploy) { this.deploy.add(ele); } return this; } /** *

* An array of custom recipe names to be run following a deploy * event. *

* * @param deploy * An array of custom recipe names to be run following a * deploy event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withDeploy(java.util.Collection deploy) { setDeploy(deploy); return this; } /** *

* An array of custom recipe names to be run following a * undeploy event. *

* * @return An array of custom recipe names to be run following a * undeploy event. */ public java.util.List getUndeploy() { if (undeploy == null) { undeploy = new com.amazonaws.internal.SdkInternalList(); } return undeploy; } /** *

* An array of custom recipe names to be run following a * undeploy event. *

* * @param undeploy * An array of custom recipe names to be run following a * undeploy event. */ public void setUndeploy(java.util.Collection undeploy) { if (undeploy == null) { this.undeploy = null; return; } this.undeploy = new com.amazonaws.internal.SdkInternalList( undeploy); } /** *

* An array of custom recipe names to be run following a * undeploy event. *

*

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

* * @param undeploy * An array of custom recipe names to be run following a * undeploy event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withUndeploy(String... undeploy) { if (this.undeploy == null) { setUndeploy(new com.amazonaws.internal.SdkInternalList( undeploy.length)); } for (String ele : undeploy) { this.undeploy.add(ele); } return this; } /** *

* An array of custom recipe names to be run following a * undeploy event. *

* * @param undeploy * An array of custom recipe names to be run following a * undeploy event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withUndeploy(java.util.Collection undeploy) { setUndeploy(undeploy); return this; } /** *

* An array of custom recipe names to be run following a * shutdown event. *

* * @return An array of custom recipe names to be run following a * shutdown event. */ public java.util.List getShutdown() { if (shutdown == null) { shutdown = new com.amazonaws.internal.SdkInternalList(); } return shutdown; } /** *

* An array of custom recipe names to be run following a * shutdown event. *

* * @param shutdown * An array of custom recipe names to be run following a * shutdown event. */ public void setShutdown(java.util.Collection shutdown) { if (shutdown == null) { this.shutdown = null; return; } this.shutdown = new com.amazonaws.internal.SdkInternalList( shutdown); } /** *

* An array of custom recipe names to be run following a * shutdown event. *

*

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

* * @param shutdown * An array of custom recipe names to be run following a * shutdown event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withShutdown(String... shutdown) { if (this.shutdown == null) { setShutdown(new com.amazonaws.internal.SdkInternalList( shutdown.length)); } for (String ele : shutdown) { this.shutdown.add(ele); } return this; } /** *

* An array of custom recipe names to be run following a * shutdown event. *

* * @param shutdown * An array of custom recipe names to be run following a * shutdown event. * @return Returns a reference to this object so that method calls can be * chained together. */ public Recipes withShutdown(java.util.Collection shutdown) { setShutdown(shutdown); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getSetup() != null) sb.append("Setup: " + getSetup() + ","); if (getConfigure() != null) sb.append("Configure: " + getConfigure() + ","); if (getDeploy() != null) sb.append("Deploy: " + getDeploy() + ","); if (getUndeploy() != null) sb.append("Undeploy: " + getUndeploy() + ","); if (getShutdown() != null) sb.append("Shutdown: " + getShutdown()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Recipes == false) return false; Recipes other = (Recipes) obj; if (other.getSetup() == null ^ this.getSetup() == null) return false; if (other.getSetup() != null && other.getSetup().equals(this.getSetup()) == false) return false; if (other.getConfigure() == null ^ this.getConfigure() == null) return false; if (other.getConfigure() != null && other.getConfigure().equals(this.getConfigure()) == false) return false; if (other.getDeploy() == null ^ this.getDeploy() == null) return false; if (other.getDeploy() != null && other.getDeploy().equals(this.getDeploy()) == false) return false; if (other.getUndeploy() == null ^ this.getUndeploy() == null) return false; if (other.getUndeploy() != null && other.getUndeploy().equals(this.getUndeploy()) == false) return false; if (other.getShutdown() == null ^ this.getShutdown() == null) return false; if (other.getShutdown() != null && other.getShutdown().equals(this.getShutdown()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSetup() == null) ? 0 : getSetup().hashCode()); hashCode = prime * hashCode + ((getConfigure() == null) ? 0 : getConfigure().hashCode()); hashCode = prime * hashCode + ((getDeploy() == null) ? 0 : getDeploy().hashCode()); hashCode = prime * hashCode + ((getUndeploy() == null) ? 0 : getUndeploy().hashCode()); hashCode = prime * hashCode + ((getShutdown() == null) ? 0 : getShutdown().hashCode()); return hashCode; } @Override public Recipes clone() { try { return (Recipes) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy