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;
 

A description of the app.

 
 public class App implements SerializableCloneable {

    
The app ID.
 
     private String appId;

    
The app stack ID.
 
     private String stackId;

    
The app's short name.
 
     private String shortname;

    
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 describes the app repository.
 
     private Source appSource;

    
The app vhost settings with multiple domains separated by commas. For example: 'www.example.com, example.com'
 
Whether to enable SSL for the app.
 
     private Boolean enableSsl;

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

    
The stack attributes.
 
     private java.util.Map<String,Stringattributes;

    
When the app was created.
 
     private String createdAt;

    
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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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 App withAppId(String appId) {
        this. = appId;
        return this;
    }

    
The app stack ID.

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

Parameters:
stackId The app stack ID.
    public void setStackId(String stackId) {
        this. = stackId;
    }
    
    
The app stack ID.

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

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

    
The app's short name.

Returns:
The app's short name.
    public String getShortname() {
        return ;
    }
    
    
The app's short name.

Parameters:
shortname The app's short name.
    public void setShortname(String shortname) {
        this. = shortname;
    }
    
    
The app's short name.

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

Parameters:
shortname The app's short name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public App withShortname(String shortname) {
        this. = shortname;
        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 App 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 App 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 App 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.
    public App withDataSources(java.util.Collection<DataSourcedataSources) {
        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 App 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 App withType(AppType type) {
        this. = type.toString();
        return this;
    }

    
A Source object that describes the app repository.

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

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

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

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

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

Returns:
The app vhost 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 vhost settings with multiple domains separated by commas. For example: 'www.example.com, example.com'

Parameters:
domains The app vhost 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 vhost 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 vhost 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 App withDomains(String... domains) {
        if (getDomains() == nullsetDomains(new java.util.ArrayList<String>(domains.length));
        for (String value : domains) {
            getDomains().add(value);
        }
        return this;
    }
    
    
The app vhost 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 vhost 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 App withDomains(java.util.Collection<Stringdomains) {
        if (domains == null) {
            this. = null;
        } else {
            domainsCopy.addAll(domains);
            this. = domainsCopy;
        }
        return this;
    }

    
Whether to enable SSL for the app.

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

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

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

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

    
Whether to enable SSL for the app.

Returns:
Whether to enable SSL 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 App withSslConfiguration(SslConfiguration sslConfiguration) {
        this. = sslConfiguration;
        return this;
    }

    
The stack attributes.

Returns:
The stack attributes.
    public java.util.Map<String,StringgetAttributes() {
        
        if ( == null) {
             = new java.util.HashMap<String,String>();
        }
        return ;
    }
    
    
The stack attributes.

Parameters:
attributes The stack attributes.
    public void setAttributes(java.util.Map<String,Stringattributes) {
        this. = attributes;
    }
    
    
The stack attributes.

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

Parameters:
attributes The stack attributes.
Returns:
A reference to this updated object so that method calls can be chained together.
    public App withAttributes(java.util.Map<String,Stringattributes) {
        setAttributes(attributes);
        return this;
    }

    
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 App 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.

  public App clearAttributesEntries() {
    this. = null;
    return this;
  }
  
    
When the app was created.

Returns:
When the app was created.
    public String getCreatedAt() {
        return ;
    }
    
    
When the app was created.

Parameters:
createdAt When the app was created.
    public void setCreatedAt(String createdAt) {
        this. = createdAt;
    }
    
    
When the app was created.

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

Parameters:
createdAt When the app was created.
Returns:
A reference to this updated object so that method calls can be chained together.
    public App withCreatedAt(String createdAt) {
        this. = createdAt;
        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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public App 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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </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. <note> 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, but if you do exceed it, you will cause an exception (API) with an "Environment: is too large (maximum is 10KB)" message. </note>
Returns:
A reference to this updated object so that method calls can be chained together.
    public App withEnvironment(java.util.Collection<EnvironmentVariableenvironment) {
        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 (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getShortname() != nullsb.append("Shortname: " + getShortname() + ",");
        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 (getCreatedAt() != nullsb.append("CreatedAt: " + getCreatedAt() + ",");
        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 + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getShortname() == null) ? 0 : getShortname().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 + ((getCreatedAt() == null) ? 0 : getCreatedAt().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 App == falsereturn false;
        App other = (App)obj;
        
        if (other.getAppId() == null ^ this.getAppId() == nullreturn false;
        if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == falsereturn false
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getShortname() == null ^ this.getShortname() == nullreturn false;
        if (other.getShortname() != null && other.getShortname().equals(this.getShortname()) == 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.getCreatedAt() == null ^ this.getCreatedAt() == nullreturn false;
        if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == 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 App clone() {
        try {
            return (Appsuper.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