Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 

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 SerializableCloneable {

    
An array of custom recipe names to be run following a setup event.
 
An array of custom recipe names to be run following a configure event.
 
An array of custom recipe names to be run following a deploy event.
 
An array of custom recipe names to be run following a undeploy event.
 
An array of custom recipe names to be run following a shutdown event.
 
An array of custom recipe names to be run following a setup event.

Returns:
An array of custom recipe names to be run following a setup event.
 
     public java.util.List<StringgetSetup() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
An array of custom recipe names to be run following a setup event.

Parameters:
setup An array of custom recipe names to be run following a setup event.
 
     public void setSetup(java.util.Collection<Stringsetup) {
         if (setup == null) {
             this. = null;
             return;
         }
        setupCopy.addAll(setup);
        this. = setupCopy;
    }
    
    
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 setSetup(java.util.Collection) or withSetup(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
setup An array of custom recipe names to be run following a setup event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withSetup(String... setup) {
        if (getSetup() == nullsetSetup(new java.util.ArrayList<String>(setup.length));
        for (String value : setup) {
            getSetup().add(value);
        }
        return this;
    }
    
    
An array of custom recipe names to be run following a setup event.

Returns a reference to this object so that method calls can be chained together.

Parameters:
setup An array of custom recipe names to be run following a setup event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withSetup(java.util.Collection<Stringsetup) {
        if (setup == null) {
            this. = null;
        } else {
            setupCopy.addAll(setup);
            this. = setupCopy;
        }
        return this;
    }

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

Returns:
An array of custom recipe names to be run following a configure event.
    public java.util.List<StringgetConfigure() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of custom recipe names to be run following a configure event.

Parameters:
configure An array of custom recipe names to be run following a configure event.
    public void setConfigure(java.util.Collection<Stringconfigure) {
        if (configure == null) {
            this. = null;
            return;
        }
        configureCopy.addAll(configure);
        this. = configureCopy;
    }
    
    
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 setConfigure(java.util.Collection) or withConfigure(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
configure An array of custom recipe names to be run following a configure event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withConfigure(String... configure) {
        if (getConfigure() == nullsetConfigure(new java.util.ArrayList<String>(configure.length));
        for (String value : configure) {
            getConfigure().add(value);
        }
        return this;
    }
    
    
An array of custom recipe names to be run following a configure event.

Returns a reference to this object so that method calls can be chained together.

Parameters:
configure An array of custom recipe names to be run following a configure event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withConfigure(java.util.Collection<Stringconfigure) {
        if (configure == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringconfigureCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(configure.size());
            configureCopy.addAll(configure);
            this. = configureCopy;
        }
        return this;
    }

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

Returns:
An array of custom recipe names to be run following a deploy event.
    public java.util.List<StringgetDeploy() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of custom recipe names to be run following a deploy event.

Parameters:
deploy An array of custom recipe names to be run following a deploy event.
    public void setDeploy(java.util.Collection<Stringdeploy) {
        if (deploy == null) {
            this. = null;
            return;
        }
        deployCopy.addAll(deploy);
        this. = deployCopy;
    }
    
    
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 setDeploy(java.util.Collection) or withDeploy(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
deploy An array of custom recipe names to be run following a deploy event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withDeploy(String... deploy) {
        if (getDeploy() == nullsetDeploy(new java.util.ArrayList<String>(deploy.length));
        for (String value : deploy) {
            getDeploy().add(value);
        }
        return this;
    }
    
    
An array of custom recipe names to be run following a deploy event.

Returns a reference to this object so that method calls can be chained together.

Parameters:
deploy An array of custom recipe names to be run following a deploy event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withDeploy(java.util.Collection<Stringdeploy) {
        if (deploy == null) {
            this. = null;
        } else {
            deployCopy.addAll(deploy);
            this. = deployCopy;
        }
        return this;
    }

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

Returns:
An array of custom recipe names to be run following a undeploy event.
    public java.util.List<StringgetUndeploy() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of custom recipe names to be run following a undeploy event.

Parameters:
undeploy An array of custom recipe names to be run following a undeploy event.
    public void setUndeploy(java.util.Collection<Stringundeploy) {
        if (undeploy == null) {
            this. = null;
            return;
        }
        undeployCopy.addAll(undeploy);
        this. = undeployCopy;
    }
    
    
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 setUndeploy(java.util.Collection) or withUndeploy(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
undeploy An array of custom recipe names to be run following a undeploy event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withUndeploy(String... undeploy) {
        if (getUndeploy() == nullsetUndeploy(new java.util.ArrayList<String>(undeploy.length));
        for (String value : undeploy) {
            getUndeploy().add(value);
        }
        return this;
    }
    
    
An array of custom recipe names to be run following a undeploy event.

Returns a reference to this object so that method calls can be chained together.

Parameters:
undeploy An array of custom recipe names to be run following a undeploy event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withUndeploy(java.util.Collection<Stringundeploy) {
        if (undeploy == null) {
            this. = null;
        } else {
            undeployCopy.addAll(undeploy);
            this. = undeployCopy;
        }
        return this;
    }

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

Returns:
An array of custom recipe names to be run following a shutdown event.
    public java.util.List<StringgetShutdown() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of custom recipe names to be run following a shutdown event.

Parameters:
shutdown An array of custom recipe names to be run following a shutdown event.
    public void setShutdown(java.util.Collection<Stringshutdown) {
        if (shutdown == null) {
            this. = null;
            return;
        }
        shutdownCopy.addAll(shutdown);
        this. = shutdownCopy;
    }
    
    
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 setShutdown(java.util.Collection) or withShutdown(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
shutdown An array of custom recipe names to be run following a shutdown event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withShutdown(String... shutdown) {
        if (getShutdown() == nullsetShutdown(new java.util.ArrayList<String>(shutdown.length));
        for (String value : shutdown) {
            getShutdown().add(value);
        }
        return this;
    }
    
    
An array of custom recipe names to be run following a shutdown event.

Returns a reference to this object so that method calls can be chained together.

Parameters:
shutdown An array of custom recipe names to be run following a shutdown event.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Recipes withShutdown(java.util.Collection<Stringshutdown) {
        if (shutdown == null) {
            this. = null;
        } else {
            shutdownCopy.addAll(shutdown);
            this. = shutdownCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSetup() != nullsb.append("Setup: " + getSetup() + ",");
        if (getConfigure() != nullsb.append("Configure: " + getConfigure() + ",");
        if (getDeploy() != nullsb.append("Deploy: " + getDeploy() + ",");
        if (getUndeploy() != nullsb.append("Undeploy: " + getUndeploy() + ",");
        if (getShutdown() != nullsb.append("Shutdown: " + getShutdown() );
        sb.append("}");
        return sb.toString();
    }
    
    @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 boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Recipes == falsereturn false;
        Recipes other = (Recipes)obj;
        
        if (other.getSetup() == null ^ this.getSetup() == nullreturn false;
        if (other.getSetup() != null && other.getSetup().equals(this.getSetup()) == falsereturn false
        if (other.getConfigure() == null ^ this.getConfigure() == nullreturn false;
        if (other.getConfigure() != null && other.getConfigure().equals(this.getConfigure()) == falsereturn false
        if (other.getDeploy() == null ^ this.getDeploy() == nullreturn false;
        if (other.getDeploy() != null && other.getDeploy().equals(this.getDeploy()) == falsereturn false
        if (other.getUndeploy() == null ^ this.getUndeploy() == nullreturn false;
        if (other.getUndeploy() != null && other.getUndeploy().equals(this.getUndeploy()) == falsereturn false
        if (other.getShutdown() == null ^ this.getShutdown() == nullreturn false;
        if (other.getShutdown() != null && other.getShutdown().equals(this.getShutdown()) == falsereturn false
        return true;
    }
    
    @Override
    public Recipes clone() {
        try {
            return (Recipessuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X