com.amazonaws.services.codegurureviewer.model.Repository Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codegurureviewer Show documentation
/*
* Copyright 2019-2024 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.codegurureviewer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about an associated Amazon Web Services CodeCommit repository or an associated repository that is managed
* by Amazon Web Services CodeStar Connections (for example, Bitbucket). This Repository
object is not used
* if your source code is in an associated GitHub repository.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Repository implements Serializable, Cloneable, StructuredPojo {
/**
*
* Information about an Amazon Web Services CodeCommit repository.
*
*/
private CodeCommitRepository codeCommit;
/**
*
* Information about a Bitbucket repository.
*
*/
private ThirdPartySourceRepository bitbucket;
/**
*
* Information about a GitHub Enterprise Server repository.
*
*/
private ThirdPartySourceRepository gitHubEnterpriseServer;
private S3Repository s3Bucket;
/**
*
* Information about an Amazon Web Services CodeCommit repository.
*
*
* @param codeCommit
* Information about an Amazon Web Services CodeCommit repository.
*/
public void setCodeCommit(CodeCommitRepository codeCommit) {
this.codeCommit = codeCommit;
}
/**
*
* Information about an Amazon Web Services CodeCommit repository.
*
*
* @return Information about an Amazon Web Services CodeCommit repository.
*/
public CodeCommitRepository getCodeCommit() {
return this.codeCommit;
}
/**
*
* Information about an Amazon Web Services CodeCommit repository.
*
*
* @param codeCommit
* Information about an Amazon Web Services CodeCommit repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Repository withCodeCommit(CodeCommitRepository codeCommit) {
setCodeCommit(codeCommit);
return this;
}
/**
*
* Information about a Bitbucket repository.
*
*
* @param bitbucket
* Information about a Bitbucket repository.
*/
public void setBitbucket(ThirdPartySourceRepository bitbucket) {
this.bitbucket = bitbucket;
}
/**
*
* Information about a Bitbucket repository.
*
*
* @return Information about a Bitbucket repository.
*/
public ThirdPartySourceRepository getBitbucket() {
return this.bitbucket;
}
/**
*
* Information about a Bitbucket repository.
*
*
* @param bitbucket
* Information about a Bitbucket repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Repository withBitbucket(ThirdPartySourceRepository bitbucket) {
setBitbucket(bitbucket);
return this;
}
/**
*
* Information about a GitHub Enterprise Server repository.
*
*
* @param gitHubEnterpriseServer
* Information about a GitHub Enterprise Server repository.
*/
public void setGitHubEnterpriseServer(ThirdPartySourceRepository gitHubEnterpriseServer) {
this.gitHubEnterpriseServer = gitHubEnterpriseServer;
}
/**
*
* Information about a GitHub Enterprise Server repository.
*
*
* @return Information about a GitHub Enterprise Server repository.
*/
public ThirdPartySourceRepository getGitHubEnterpriseServer() {
return this.gitHubEnterpriseServer;
}
/**
*
* Information about a GitHub Enterprise Server repository.
*
*
* @param gitHubEnterpriseServer
* Information about a GitHub Enterprise Server repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Repository withGitHubEnterpriseServer(ThirdPartySourceRepository gitHubEnterpriseServer) {
setGitHubEnterpriseServer(gitHubEnterpriseServer);
return this;
}
/**
* @param s3Bucket
*/
public void setS3Bucket(S3Repository s3Bucket) {
this.s3Bucket = s3Bucket;
}
/**
* @return
*/
public S3Repository getS3Bucket() {
return this.s3Bucket;
}
/**
* @param s3Bucket
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Repository withS3Bucket(S3Repository s3Bucket) {
setS3Bucket(s3Bucket);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCodeCommit() != null)
sb.append("CodeCommit: ").append(getCodeCommit()).append(",");
if (getBitbucket() != null)
sb.append("Bitbucket: ").append(getBitbucket()).append(",");
if (getGitHubEnterpriseServer() != null)
sb.append("GitHubEnterpriseServer: ").append(getGitHubEnterpriseServer()).append(",");
if (getS3Bucket() != null)
sb.append("S3Bucket: ").append(getS3Bucket());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Repository == false)
return false;
Repository other = (Repository) obj;
if (other.getCodeCommit() == null ^ this.getCodeCommit() == null)
return false;
if (other.getCodeCommit() != null && other.getCodeCommit().equals(this.getCodeCommit()) == false)
return false;
if (other.getBitbucket() == null ^ this.getBitbucket() == null)
return false;
if (other.getBitbucket() != null && other.getBitbucket().equals(this.getBitbucket()) == false)
return false;
if (other.getGitHubEnterpriseServer() == null ^ this.getGitHubEnterpriseServer() == null)
return false;
if (other.getGitHubEnterpriseServer() != null && other.getGitHubEnterpriseServer().equals(this.getGitHubEnterpriseServer()) == false)
return false;
if (other.getS3Bucket() == null ^ this.getS3Bucket() == null)
return false;
if (other.getS3Bucket() != null && other.getS3Bucket().equals(this.getS3Bucket()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCodeCommit() == null) ? 0 : getCodeCommit().hashCode());
hashCode = prime * hashCode + ((getBitbucket() == null) ? 0 : getBitbucket().hashCode());
hashCode = prime * hashCode + ((getGitHubEnterpriseServer() == null) ? 0 : getGitHubEnterpriseServer().hashCode());
hashCode = prime * hashCode + ((getS3Bucket() == null) ? 0 : getS3Bucket().hashCode());
return hashCode;
}
@Override
public Repository clone() {
try {
return (Repository) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.codegurureviewer.model.transform.RepositoryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}