com.amazonaws.services.emrserverless.model.ConfigurationOverrides Maven / Gradle / Ivy
Show all versions of aws-java-sdk-emrserverless 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.emrserverless.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A configuration specification to be used to override existing configurations.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConfigurationOverrides implements Serializable, Cloneable, StructuredPojo {
/**
*
* The override configurations for the application.
*
*/
private java.util.List applicationConfiguration;
/**
*
* The override configurations for monitoring.
*
*/
private MonitoringConfiguration monitoringConfiguration;
/**
*
* The override configurations for the application.
*
*
* @return The override configurations for the application.
*/
public java.util.List getApplicationConfiguration() {
return applicationConfiguration;
}
/**
*
* The override configurations for the application.
*
*
* @param applicationConfiguration
* The override configurations for the application.
*/
public void setApplicationConfiguration(java.util.Collection applicationConfiguration) {
if (applicationConfiguration == null) {
this.applicationConfiguration = null;
return;
}
this.applicationConfiguration = new java.util.ArrayList(applicationConfiguration);
}
/**
*
* The override configurations for the application.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setApplicationConfiguration(java.util.Collection)} or
* {@link #withApplicationConfiguration(java.util.Collection)} if you want to override the existing values.
*
*
* @param applicationConfiguration
* The override configurations for the application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationOverrides withApplicationConfiguration(Configuration... applicationConfiguration) {
if (this.applicationConfiguration == null) {
setApplicationConfiguration(new java.util.ArrayList(applicationConfiguration.length));
}
for (Configuration ele : applicationConfiguration) {
this.applicationConfiguration.add(ele);
}
return this;
}
/**
*
* The override configurations for the application.
*
*
* @param applicationConfiguration
* The override configurations for the application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationOverrides withApplicationConfiguration(java.util.Collection applicationConfiguration) {
setApplicationConfiguration(applicationConfiguration);
return this;
}
/**
*
* The override configurations for monitoring.
*
*
* @param monitoringConfiguration
* The override configurations for monitoring.
*/
public void setMonitoringConfiguration(MonitoringConfiguration monitoringConfiguration) {
this.monitoringConfiguration = monitoringConfiguration;
}
/**
*
* The override configurations for monitoring.
*
*
* @return The override configurations for monitoring.
*/
public MonitoringConfiguration getMonitoringConfiguration() {
return this.monitoringConfiguration;
}
/**
*
* The override configurations for monitoring.
*
*
* @param monitoringConfiguration
* The override configurations for monitoring.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigurationOverrides withMonitoringConfiguration(MonitoringConfiguration monitoringConfiguration) {
setMonitoringConfiguration(monitoringConfiguration);
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 (getApplicationConfiguration() != null)
sb.append("ApplicationConfiguration: ").append(getApplicationConfiguration()).append(",");
if (getMonitoringConfiguration() != null)
sb.append("MonitoringConfiguration: ").append(getMonitoringConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConfigurationOverrides == false)
return false;
ConfigurationOverrides other = (ConfigurationOverrides) obj;
if (other.getApplicationConfiguration() == null ^ this.getApplicationConfiguration() == null)
return false;
if (other.getApplicationConfiguration() != null && other.getApplicationConfiguration().equals(this.getApplicationConfiguration()) == false)
return false;
if (other.getMonitoringConfiguration() == null ^ this.getMonitoringConfiguration() == null)
return false;
if (other.getMonitoringConfiguration() != null && other.getMonitoringConfiguration().equals(this.getMonitoringConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getApplicationConfiguration() == null) ? 0 : getApplicationConfiguration().hashCode());
hashCode = prime * hashCode + ((getMonitoringConfiguration() == null) ? 0 : getMonitoringConfiguration().hashCode());
return hashCode;
}
@Override
public ConfigurationOverrides clone() {
try {
return (ConfigurationOverrides) 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.emrserverless.model.transform.ConfigurationOverridesMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}