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;
 
 
Container for the parameters to the UpdateApp operation.

Updates a specified app.

Required Permissions : To use this action, an IAM user must have a Deploy or Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions .

 
 public class UpdateAppRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The app ID.
 
     private String appId;

    
The app name.
 
     private String name;

    
A description of the app.
 
     private String description;

    
The app's data sources.
 
The app type.

Constraints:
Allowed Values: java, rails, php, nodejs, static, other

 
     private String type;

    
A Source object that specifies the app repository.
 
     private Source appSource;

    
The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'
 
Whether SSL is enabled for the app.
 
     private Boolean enableSsl;

    
An SslConfiguration object with the SSL configuration.
 
     private SslConfiguration sslConfiguration;

    
One or more user-defined key/value pairs to be added to the stack attributes.
 
     private java.util.Map<String,Stringattributes;

    
An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

The app ID.

Returns:
The app ID.
    public String getAppId() {
        return ;
    }
    
    
The app ID.

Parameters:
appId The app ID.
    public void setAppId(String appId) {
        this. = appId;
    }
    
    
The app ID.

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

Parameters:
appId The app ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withAppId(String appId) {
        this. = appId;
        return this;
    }

    
The app name.

Returns:
The app name.
    public String getName() {
        return ;
    }
    
    
The app name.

Parameters:
name The app name.
    public void setName(String name) {
        this. = name;
    }
    
    
The app name.

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

Parameters:
name The app name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withName(String name) {
        this. = name;
        return this;
    }

    
A description of the app.

Returns:
A description of the app.
    public String getDescription() {
        return ;
    }
    
    
A description of the app.

Parameters:
description A description of the app.
    public void setDescription(String description) {
        this. = description;
    }
    
    
A description of the app.

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

Parameters:
description A description of the app.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withDescription(String description) {
        this. = description;
        return this;
    }

    
The app's data sources.

Returns:
The app's data sources.
    public java.util.List<DataSourcegetDataSources() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<DataSource>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The app's data sources.

Parameters:
dataSources The app's data sources.
    public void setDataSources(java.util.Collection<DataSourcedataSources) {
        if (dataSources == null) {
            this. = null;
            return;
        }
        dataSourcesCopy.addAll(dataSources);
        this. = dataSourcesCopy;
    }
    
    
The app's data sources.

NOTE: This method appends the values to the existing list (if any). Use setDataSources(java.util.Collection) or withDataSources(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:
dataSources The app's data sources.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withDataSources(DataSource... dataSources) {
        if (getDataSources() == nullsetDataSources(new java.util.ArrayList<DataSource>(dataSources.length));
        for (DataSource value : dataSources) {
            getDataSources().add(value);
        }
        return this;
    }
    
    
The app's data sources.

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

Parameters:
dataSources The app's data sources.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (dataSources == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<DataSourcedataSourcesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<DataSource>(dataSources.size());
            dataSourcesCopy.addAll(dataSources);
            this. = dataSourcesCopy;
        }
        return this;
    }

    
The app type.

Constraints:
Allowed Values: java, rails, php, nodejs, static, other

Returns:
The app type.
See also:
AppType
    public String getType() {
        return ;
    }
    
    
The app type.

Constraints:
Allowed Values: java, rails, php, nodejs, static, other

Parameters:
type The app type.
See also:
AppType
    public void setType(String type) {
        this. = type;
    }
    
    
The app type.

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

Constraints:
Allowed Values: java, rails, php, nodejs, static, other

Parameters:
type The app type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AppType
    public UpdateAppRequest withType(String type) {
        this. = type;
        return this;
    }

    
The app type.

Constraints:
Allowed Values: java, rails, php, nodejs, static, other

Parameters:
type The app type.
See also:
AppType
    public void setType(AppType type) {
        this. = type.toString();
    }
    
    
The app type.

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

Constraints:
Allowed Values: java, rails, php, nodejs, static, other

Parameters:
type The app type.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
AppType
    public UpdateAppRequest withType(AppType type) {
        this. = type.toString();
        return this;
    }

    
A Source object that specifies the app repository.

Returns:
A Source object that specifies the app repository.
    public Source getAppSource() {
        return ;
    }
    
    
A Source object that specifies the app repository.

Parameters:
appSource A Source object that specifies the app repository.
    public void setAppSource(Source appSource) {
        this. = appSource;
    }
    
    
A Source object that specifies the app repository.

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

Parameters:
appSource A Source object that specifies the app repository.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withAppSource(Source appSource) {
        this. = appSource;
        return this;
    }

    
The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'

Returns:
The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'
    public java.util.List<StringgetDomains() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'

Parameters:
domains The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'
    public void setDomains(java.util.Collection<Stringdomains) {
        if (domains == null) {
            this. = null;
            return;
        }
        domainsCopy.addAll(domains);
        this. = domainsCopy;
    }
    
    
The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'

NOTE: This method appends the values to the existing list (if any). Use setDomains(java.util.Collection) or withDomains(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:
domains The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withDomains(String... domains) {
        if (getDomains() == nullsetDomains(new java.util.ArrayList<String>(domains.length));
        for (String value : domains) {
            getDomains().add(value);
        }
        return this;
    }
    
    
The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'

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

Parameters:
domains The app's virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withDomains(java.util.Collection<Stringdomains) {
        if (domains == null) {
            this. = null;
        } else {
            domainsCopy.addAll(domains);
            this. = domainsCopy;
        }
        return this;
    }

    
Whether SSL is enabled for the app.

Returns:
Whether SSL is enabled for the app.
    public Boolean isEnableSsl() {
        return ;
    }
    
    
Whether SSL is enabled for the app.

Parameters:
enableSsl Whether SSL is enabled for the app.
    public void setEnableSsl(Boolean enableSsl) {
        this. = enableSsl;
    }
    
    
Whether SSL is enabled for the app.

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

Parameters:
enableSsl Whether SSL is enabled for the app.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withEnableSsl(Boolean enableSsl) {
        this. = enableSsl;
        return this;
    }

    
Whether SSL is enabled for the app.

Returns:
Whether SSL is enabled for the app.
    public Boolean getEnableSsl() {
        return ;
    }

    
An SslConfiguration object with the SSL configuration.

Returns:
An SslConfiguration object with the SSL configuration.
        return ;
    }
    
    
An SslConfiguration object with the SSL configuration.

Parameters:
sslConfiguration An SslConfiguration object with the SSL configuration.
    public void setSslConfiguration(SslConfiguration sslConfiguration) {
        this. = sslConfiguration;
    }
    
    
An SslConfiguration object with the SSL configuration.

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

Parameters:
sslConfiguration An SslConfiguration object with the SSL configuration.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withSslConfiguration(SslConfiguration sslConfiguration) {
        this. = sslConfiguration;
        return this;
    }

    
One or more user-defined key/value pairs to be added to the stack attributes.

Returns:
One or more user-defined key/value pairs to be added to the stack attributes.
    public java.util.Map<String,StringgetAttributes() {
        
        if ( == null) {
             = new java.util.HashMap<String,String>();
        }
        return ;
    }
    
    
One or more user-defined key/value pairs to be added to the stack attributes.

Parameters:
attributes One or more user-defined key/value pairs to be added to the stack attributes.
    public void setAttributes(java.util.Map<String,Stringattributes) {
        this. = attributes;
    }
    
    
One or more user-defined key/value pairs to be added to the stack attributes.

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

Parameters:
attributes One or more user-defined key/value pairs to be added to the stack attributes.
Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withAttributes(java.util.Map<String,Stringattributes) {
        setAttributes(attributes);
        return this;
    }

    
One or more user-defined key/value pairs to be added to the stack attributes.

The method adds a new key-value pair into Attributes parameter, and returns a reference to this object so that method calls can be chained together.

Parameters:
key The key of the entry to be added into Attributes.
value The corresponding value of the entry to be added into Attributes.
  public UpdateAppRequest addAttributesEntry(String keyString value) {
    if (null == this.) {
      this. = new java.util.HashMap<String,String>();
    }
    if (this..containsKey(key))
      throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
    this..put(keyvalue);
    return this;
  }

  
Removes all the entries added into Attributes.

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

    this. = null;
    return this;
  }
  
    
An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

Returns:
An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

Parameters:
environment An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

    public void setEnvironment(java.util.Collection<EnvironmentVariableenvironment) {
        if (environment == null) {
            this. = null;
            return;
        }
        environmentCopy.addAll(environment);
        this. = environmentCopy;
    }
    
    
An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

NOTE: This method appends the values to the existing list (if any). Use setEnvironment(java.util.Collection) or withEnvironment(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:
environment An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

Returns:
A reference to this updated object so that method calls can be chained together.
    public UpdateAppRequest withEnvironment(EnvironmentVariable... environment) {
        if (getEnvironment() == nullsetEnvironment(new java.util.ArrayList<EnvironmentVariable>(environment.length));
        for (EnvironmentVariable value : environment) {
            getEnvironment().add(value);
        }
        return this;
    }
    
    
An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

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

Parameters:
environment An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instances.For more information, see Environment Variables.

There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 10 KB (10240 Bytes). This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 10KB)." <note>This parameter is supported only by Chef 11.10 stacks. If you have specified one or more environment variables, you cannot modify the stack's Chef version. </note>

Returns:
A reference to this updated object so that method calls can be chained together.
        if (environment == null) {
            this. = null;
        } else {
            environmentCopy.addAll(environment);
            this. = environmentCopy;
        }
        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 (getAppId() != nullsb.append("AppId: " + getAppId() + ",");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getDescription() != nullsb.append("Description: " + getDescription() + ",");
        if (getDataSources() != nullsb.append("DataSources: " + getDataSources() + ",");
        if (getType() != nullsb.append("Type: " + getType() + ",");
        if (getAppSource() != nullsb.append("AppSource: " + getAppSource() + ",");
        if (getDomains() != nullsb.append("Domains: " + getDomains() + ",");
        if (isEnableSsl() != nullsb.append("EnableSsl: " + isEnableSsl() + ",");
        if (getSslConfiguration() != nullsb.append("SslConfiguration: " + getSslConfiguration() + ",");
        if (getAttributes() != nullsb.append("Attributes: " + getAttributes() + ",");
        if (getEnvironment() != nullsb.append("Environment: " + getEnvironment() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode()); 
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); 
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); 
        hashCode = prime * hashCode + ((getDataSources() == null) ? 0 : getDataSources().hashCode()); 
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        hashCode = prime * hashCode + ((getAppSource() == null) ? 0 : getAppSource().hashCode()); 
        hashCode = prime * hashCode + ((getDomains() == null) ? 0 : getDomains().hashCode()); 
        hashCode = prime * hashCode + ((isEnableSsl() == null) ? 0 : isEnableSsl().hashCode()); 
        hashCode = prime * hashCode + ((getSslConfiguration() == null) ? 0 : getSslConfiguration().hashCode()); 
        hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); 
        hashCode = prime * hashCode + ((getEnvironment() == null) ? 0 : getEnvironment().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof UpdateAppRequest == falsereturn false;
        UpdateAppRequest other = (UpdateAppRequest)obj;
        
        if (other.getAppId() == null ^ this.getAppId() == nullreturn false;
        if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == falsereturn false
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getDescription() == null ^ this.getDescription() == nullreturn false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == falsereturn false
        if (other.getDataSources() == null ^ this.getDataSources() == nullreturn false;
        if (other.getDataSources() != null && other.getDataSources().equals(this.getDataSources()) == falsereturn false
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        if (other.getAppSource() == null ^ this.getAppSource() == nullreturn false;
        if (other.getAppSource() != null && other.getAppSource().equals(this.getAppSource()) == falsereturn false
        if (other.getDomains() == null ^ this.getDomains() == nullreturn false;
        if (other.getDomains() != null && other.getDomains().equals(this.getDomains()) == falsereturn false
        if (other.isEnableSsl() == null ^ this.isEnableSsl() == nullreturn false;
        if (other.isEnableSsl() != null && other.isEnableSsl().equals(this.isEnableSsl()) == falsereturn false
        if (other.getSslConfiguration() == null ^ this.getSslConfiguration() == nullreturn false;
        if (other.getSslConfiguration() != null && other.getSslConfiguration().equals(this.getSslConfiguration()) == falsereturn false
        if (other.getAttributes() == null ^ this.getAttributes() == nullreturn false;
        if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == falsereturn false
        if (other.getEnvironment() == null ^ this.getEnvironment() == nullreturn false;
        if (other.getEnvironment() != null && other.getEnvironment().equals(this.getEnvironment()) == falsereturn false
        return true;
    }
    
    @Override
    public UpdateAppRequest clone() {
        
            return (UpdateAppRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X