com.amazonaws.services.codepipeline.model.JobWorkerExecutorConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codepipeline Show documentation
/*
* Copyright 2016-2021 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.codepipeline.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Details about the polling configuration for the JobWorker
action engine, or executor.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class JobWorkerExecutorConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The accounts in which the job worker is configured and might poll for jobs as part of the action execution.
*
*/
private java.util.List pollingAccounts;
/**
*
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
*
*/
private java.util.List pollingServicePrincipals;
/**
*
* The accounts in which the job worker is configured and might poll for jobs as part of the action execution.
*
*
* @return The accounts in which the job worker is configured and might poll for jobs as part of the action
* execution.
*/
public java.util.List getPollingAccounts() {
return pollingAccounts;
}
/**
*
* The accounts in which the job worker is configured and might poll for jobs as part of the action execution.
*
*
* @param pollingAccounts
* The accounts in which the job worker is configured and might poll for jobs as part of the action
* execution.
*/
public void setPollingAccounts(java.util.Collection pollingAccounts) {
if (pollingAccounts == null) {
this.pollingAccounts = null;
return;
}
this.pollingAccounts = new java.util.ArrayList(pollingAccounts);
}
/**
*
* The accounts in which the job worker is configured and might poll for jobs as part of the action execution.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPollingAccounts(java.util.Collection)} or {@link #withPollingAccounts(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param pollingAccounts
* The accounts in which the job worker is configured and might poll for jobs as part of the action
* execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobWorkerExecutorConfiguration withPollingAccounts(String... pollingAccounts) {
if (this.pollingAccounts == null) {
setPollingAccounts(new java.util.ArrayList(pollingAccounts.length));
}
for (String ele : pollingAccounts) {
this.pollingAccounts.add(ele);
}
return this;
}
/**
*
* The accounts in which the job worker is configured and might poll for jobs as part of the action execution.
*
*
* @param pollingAccounts
* The accounts in which the job worker is configured and might poll for jobs as part of the action
* execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobWorkerExecutorConfiguration withPollingAccounts(java.util.Collection pollingAccounts) {
setPollingAccounts(pollingAccounts);
return this;
}
/**
*
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
*
*
* @return The service Principals in which the job worker is configured and might poll for jobs as part of the
* action execution.
*/
public java.util.List getPollingServicePrincipals() {
return pollingServicePrincipals;
}
/**
*
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
*
*
* @param pollingServicePrincipals
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
*/
public void setPollingServicePrincipals(java.util.Collection pollingServicePrincipals) {
if (pollingServicePrincipals == null) {
this.pollingServicePrincipals = null;
return;
}
this.pollingServicePrincipals = new java.util.ArrayList(pollingServicePrincipals);
}
/**
*
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setPollingServicePrincipals(java.util.Collection)} or
* {@link #withPollingServicePrincipals(java.util.Collection)} if you want to override the existing values.
*
*
* @param pollingServicePrincipals
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobWorkerExecutorConfiguration withPollingServicePrincipals(String... pollingServicePrincipals) {
if (this.pollingServicePrincipals == null) {
setPollingServicePrincipals(new java.util.ArrayList(pollingServicePrincipals.length));
}
for (String ele : pollingServicePrincipals) {
this.pollingServicePrincipals.add(ele);
}
return this;
}
/**
*
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
*
*
* @param pollingServicePrincipals
* The service Principals in which the job worker is configured and might poll for jobs as part of the action
* execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobWorkerExecutorConfiguration withPollingServicePrincipals(java.util.Collection pollingServicePrincipals) {
setPollingServicePrincipals(pollingServicePrincipals);
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 (getPollingAccounts() != null)
sb.append("PollingAccounts: ").append(getPollingAccounts()).append(",");
if (getPollingServicePrincipals() != null)
sb.append("PollingServicePrincipals: ").append(getPollingServicePrincipals());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof JobWorkerExecutorConfiguration == false)
return false;
JobWorkerExecutorConfiguration other = (JobWorkerExecutorConfiguration) obj;
if (other.getPollingAccounts() == null ^ this.getPollingAccounts() == null)
return false;
if (other.getPollingAccounts() != null && other.getPollingAccounts().equals(this.getPollingAccounts()) == false)
return false;
if (other.getPollingServicePrincipals() == null ^ this.getPollingServicePrincipals() == null)
return false;
if (other.getPollingServicePrincipals() != null && other.getPollingServicePrincipals().equals(this.getPollingServicePrincipals()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPollingAccounts() == null) ? 0 : getPollingAccounts().hashCode());
hashCode = prime * hashCode + ((getPollingServicePrincipals() == null) ? 0 : getPollingServicePrincipals().hashCode());
return hashCode;
}
@Override
public JobWorkerExecutorConfiguration clone() {
try {
return (JobWorkerExecutorConfiguration) 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.codepipeline.model.transform.JobWorkerExecutorConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}