/* * Copyright 2018-2023 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.emrcontainers.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. This data type allows job template * parameters to be specified within. *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ParametricConfigurationOverrides implements Serializable, Cloneable, StructuredPojo { /** *

* The configurations for the application running by the job run. *

*/ private java.util.List applicationConfiguration; /** *

* The configurations for monitoring. *

*/ private ParametricMonitoringConfiguration monitoringConfiguration; /** *

* The configurations for the application running by the job run. *

* * @return The configurations for the application running by the job run. */ public java.util.List getApplicationConfiguration() { return applicationConfiguration; } /** *

* The configurations for the application running by the job run. *

* * @param applicationConfiguration * The configurations for the application running by the job run. */ public void setApplicationConfiguration(java.util.Collection applicationConfiguration) { if (applicationConfiguration == null) { this.applicationConfiguration = null; return; } this.applicationConfiguration = new java.util.ArrayList(applicationConfiguration); } /** *

* The configurations for the application running by the job run. *

*

* 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 configurations for the application running by the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public ParametricConfigurationOverrides 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 configurations for the application running by the job run. *

* * @param applicationConfiguration * The configurations for the application running by the job run. * @return Returns a reference to this object so that method calls can be chained together. */ public ParametricConfigurationOverrides withApplicationConfiguration(java.util.Collection applicationConfiguration) { setApplicationConfiguration(applicationConfiguration); return this; } /** *

* The configurations for monitoring. *

* * @param monitoringConfiguration * The configurations for monitoring. */ public void setMonitoringConfiguration(ParametricMonitoringConfiguration monitoringConfiguration) { this.monitoringConfiguration = monitoringConfiguration; } /** *

* The configurations for monitoring. *

* * @return The configurations for monitoring. */ public ParametricMonitoringConfiguration getMonitoringConfiguration() { return this.monitoringConfiguration; } /** *

* The configurations for monitoring. *

* * @param monitoringConfiguration * The configurations for monitoring. * @return Returns a reference to this object so that method calls can be chained together. */ public ParametricConfigurationOverrides withMonitoringConfiguration(ParametricMonitoringConfiguration 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 ParametricConfigurationOverrides == false) return false; ParametricConfigurationOverrides other = (ParametricConfigurationOverrides) 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 ParametricConfigurationOverrides clone() { try { return (ParametricConfigurationOverrides) 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.emrcontainers.model.transform.ParametricConfigurationOverridesMarshaller.getInstance().marshall(this, protocolMarshaller); } }