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;
 

Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps or Custom Recipes and Cookbooks .

 
 public class Source implements SerializableCloneable {

    
The repository type.

Constraints:
Allowed Values: git, svn, archive, s3

 
     private String type;

    
The source URL.
 
     private String url;

    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.
 
     private String username;

    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

 
     private String password;

    
The repository's SSH key.
 
     private String sshKey;

    
The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.
 
     private String revision;

    
The repository type.

Constraints:
Allowed Values: git, svn, archive, s3

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

Constraints:
Allowed Values: git, svn, archive, s3

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

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

Constraints:
Allowed Values: git, svn, archive, s3

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

    
The repository type.

Constraints:
Allowed Values: git, svn, archive, s3

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

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

Constraints:
Allowed Values: git, svn, archive, s3

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

    
The source URL.

Returns:
The source URL.
    public String getUrl() {
        return ;
    }
    
    
The source URL.

Parameters:
url The source URL.
    public void setUrl(String url) {
        this. = url;
    }
    
    
The source URL.

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

Parameters:
url The source URL.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Source withUrl(String url) {
        this. = url;
        return this;
    }

    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

Returns:
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.
    public String getUsername() {
        return ;
    }
    
    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

Parameters:
username This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.
    public void setUsername(String username) {
        this. = username;
    }
    
    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

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

Parameters:
username This parameter depends on the repository type.
  • For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
  • For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Source withUsername(String username) {
        this. = username;
        return this;
    }

    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

Returns:
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

    public String getPassword() {
        return ;
    }
    
    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

Parameters:
password This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

    public void setPassword(String password) {
        this. = password;
    }
    
    
This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

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

Parameters:
password This parameter depends on the repository type.
  • For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
  • For HTTP bundles and Subversion repositories, set Password to the password.

For more information on how to safely handle IAM credentials, see .

Returns:
A reference to this updated object so that method calls can be chained together.

    public Source withPassword(String password) {
        this. = password;
        return this;
    }

    
The repository's SSH key.

Returns:
The repository's SSH key.
    public String getSshKey() {
        return ;
    }
    
    
The repository's SSH key.

Parameters:
sshKey The repository's SSH key.
    public void setSshKey(String sshKey) {
        this. = sshKey;
    }
    
    
The repository's SSH key.

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

Parameters:
sshKey The repository's SSH key.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Source withSshKey(String sshKey) {
        this. = sshKey;
        return this;
    }

    
The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

Returns:
The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.
    public String getRevision() {
        return ;
    }
    
    
The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

Parameters:
revision The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.
    public void setRevision(String revision) {
        this. = revision;
    }
    
    
The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

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

Parameters:
revision The application's version. AWS OpsWorks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Source withRevision(String revision) {
        this. = revision;
        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 (getType() != nullsb.append("Type: " + getType() + ",");
        if (getUrl() != nullsb.append("Url: " + getUrl() + ",");
        if (getUsername() != nullsb.append("Username: " + getUsername() + ",");
        if (getPassword() != nullsb.append("Password: " + getPassword() + ",");
        if (getSshKey() != nullsb.append("SshKey: " + getSshKey() + ",");
        if (getRevision() != nullsb.append("Revision: " + getRevision() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); 
        hashCode = prime * hashCode + ((getUrl() == null) ? 0 : getUrl().hashCode()); 
        hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode()); 
        hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode()); 
        hashCode = prime * hashCode + ((getSshKey() == null) ? 0 : getSshKey().hashCode()); 
        hashCode = prime * hashCode + ((getRevision() == null) ? 0 : getRevision().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Source == falsereturn false;
        Source other = (Source)obj;
        
        if (other.getType() == null ^ this.getType() == nullreturn false;
        if (other.getType() != null && other.getType().equals(this.getType()) == falsereturn false
        if (other.getUrl() == null ^ this.getUrl() == nullreturn false;
        if (other.getUrl() != null && other.getUrl().equals(this.getUrl()) == falsereturn false
        if (other.getUsername() == null ^ this.getUsername() == nullreturn false;
        if (other.getUsername() != null && other.getUsername().equals(this.getUsername()) == falsereturn false
        if (other.getPassword() == null ^ this.getPassword() == nullreturn false;
        if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == falsereturn false
        if (other.getSshKey() == null ^ this.getSshKey() == nullreturn false;
        if (other.getSshKey() != null && other.getSshKey().equals(this.getSshKey()) == falsereturn false
        if (other.getRevision() == null ^ this.getRevision() == nullreturn false;
        if (other.getRevision() != null && other.getRevision().equals(this.getRevision()) == falsereturn false
        return true;
    }
    
    @Override
    public Source clone() {
        try {
            return (Sourcesuper.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