com.amazonaws.services.resiliencehub.model.ConfigRecommendation Maven / Gradle / Ivy
Show all versions of aws-java-sdk-resiliencehub 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.resiliencehub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Defines a recommendation configuration.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConfigRecommendation implements Serializable, Cloneable, StructuredPojo {
/**
*
* Name of the Application Component.
*
*/
private String appComponentName;
/**
*
* The current compliance against the resiliency policy before applying the configuration change.
*
*/
private java.util.Map compliance;
/**
*
* The cost for the application.
*
*/
private Cost cost;
/**
*
* The optional description for an app.
*
*/
private String description;
/**
*
* The architecture type.
*
*/
private String haArchitecture;
/**
*
* The name of the recommendation configuration.
*
*/
private String name;
/**
*
* The type of optimization.
*
*/
private String optimizationType;
/**
*
* The expected compliance against the resiliency policy after applying the configuration change.
*
*/
private java.util.Map recommendationCompliance;
/**
*
* Reference identifier for the recommendation configuration.
*
*/
private String referenceId;
/**
*
* List of the suggested configuration changes.
*
*/
private java.util.List suggestedChanges;
/**
*
* Name of the Application Component.
*
*
* @param appComponentName
* Name of the Application Component.
*/
public void setAppComponentName(String appComponentName) {
this.appComponentName = appComponentName;
}
/**
*
* Name of the Application Component.
*
*
* @return Name of the Application Component.
*/
public String getAppComponentName() {
return this.appComponentName;
}
/**
*
* Name of the Application Component.
*
*
* @param appComponentName
* Name of the Application Component.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withAppComponentName(String appComponentName) {
setAppComponentName(appComponentName);
return this;
}
/**
*
* The current compliance against the resiliency policy before applying the configuration change.
*
*
* @return The current compliance against the resiliency policy before applying the configuration change.
*/
public java.util.Map getCompliance() {
return compliance;
}
/**
*
* The current compliance against the resiliency policy before applying the configuration change.
*
*
* @param compliance
* The current compliance against the resiliency policy before applying the configuration change.
*/
public void setCompliance(java.util.Map compliance) {
this.compliance = compliance;
}
/**
*
* The current compliance against the resiliency policy before applying the configuration change.
*
*
* @param compliance
* The current compliance against the resiliency policy before applying the configuration change.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withCompliance(java.util.Map compliance) {
setCompliance(compliance);
return this;
}
/**
* Add a single Compliance entry
*
* @see ConfigRecommendation#withCompliance
* @returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation addComplianceEntry(String key, DisruptionCompliance value) {
if (null == this.compliance) {
this.compliance = new java.util.HashMap();
}
if (this.compliance.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.compliance.put(key, value);
return this;
}
/**
* Removes all the entries added into Compliance.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation clearComplianceEntries() {
this.compliance = null;
return this;
}
/**
*
* The cost for the application.
*
*
* @param cost
* The cost for the application.
*/
public void setCost(Cost cost) {
this.cost = cost;
}
/**
*
* The cost for the application.
*
*
* @return The cost for the application.
*/
public Cost getCost() {
return this.cost;
}
/**
*
* The cost for the application.
*
*
* @param cost
* The cost for the application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withCost(Cost cost) {
setCost(cost);
return this;
}
/**
*
* The optional description for an app.
*
*
* @param description
* The optional description for an app.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The optional description for an app.
*
*
* @return The optional description for an app.
*/
public String getDescription() {
return this.description;
}
/**
*
* The optional description for an app.
*
*
* @param description
* The optional description for an app.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The architecture type.
*
*
* @param haArchitecture
* The architecture type.
* @see HaArchitecture
*/
public void setHaArchitecture(String haArchitecture) {
this.haArchitecture = haArchitecture;
}
/**
*
* The architecture type.
*
*
* @return The architecture type.
* @see HaArchitecture
*/
public String getHaArchitecture() {
return this.haArchitecture;
}
/**
*
* The architecture type.
*
*
* @param haArchitecture
* The architecture type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see HaArchitecture
*/
public ConfigRecommendation withHaArchitecture(String haArchitecture) {
setHaArchitecture(haArchitecture);
return this;
}
/**
*
* The architecture type.
*
*
* @param haArchitecture
* The architecture type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see HaArchitecture
*/
public ConfigRecommendation withHaArchitecture(HaArchitecture haArchitecture) {
this.haArchitecture = haArchitecture.toString();
return this;
}
/**
*
* The name of the recommendation configuration.
*
*
* @param name
* The name of the recommendation configuration.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the recommendation configuration.
*
*
* @return The name of the recommendation configuration.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the recommendation configuration.
*
*
* @param name
* The name of the recommendation configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withName(String name) {
setName(name);
return this;
}
/**
*
* The type of optimization.
*
*
* @param optimizationType
* The type of optimization.
* @see ConfigRecommendationOptimizationType
*/
public void setOptimizationType(String optimizationType) {
this.optimizationType = optimizationType;
}
/**
*
* The type of optimization.
*
*
* @return The type of optimization.
* @see ConfigRecommendationOptimizationType
*/
public String getOptimizationType() {
return this.optimizationType;
}
/**
*
* The type of optimization.
*
*
* @param optimizationType
* The type of optimization.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConfigRecommendationOptimizationType
*/
public ConfigRecommendation withOptimizationType(String optimizationType) {
setOptimizationType(optimizationType);
return this;
}
/**
*
* The type of optimization.
*
*
* @param optimizationType
* The type of optimization.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConfigRecommendationOptimizationType
*/
public ConfigRecommendation withOptimizationType(ConfigRecommendationOptimizationType optimizationType) {
this.optimizationType = optimizationType.toString();
return this;
}
/**
*
* The expected compliance against the resiliency policy after applying the configuration change.
*
*
* @return The expected compliance against the resiliency policy after applying the configuration change.
*/
public java.util.Map getRecommendationCompliance() {
return recommendationCompliance;
}
/**
*
* The expected compliance against the resiliency policy after applying the configuration change.
*
*
* @param recommendationCompliance
* The expected compliance against the resiliency policy after applying the configuration change.
*/
public void setRecommendationCompliance(java.util.Map recommendationCompliance) {
this.recommendationCompliance = recommendationCompliance;
}
/**
*
* The expected compliance against the resiliency policy after applying the configuration change.
*
*
* @param recommendationCompliance
* The expected compliance against the resiliency policy after applying the configuration change.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withRecommendationCompliance(java.util.Map recommendationCompliance) {
setRecommendationCompliance(recommendationCompliance);
return this;
}
/**
* Add a single RecommendationCompliance entry
*
* @see ConfigRecommendation#withRecommendationCompliance
* @returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation addRecommendationComplianceEntry(String key, RecommendationDisruptionCompliance value) {
if (null == this.recommendationCompliance) {
this.recommendationCompliance = new java.util.HashMap();
}
if (this.recommendationCompliance.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.recommendationCompliance.put(key, value);
return this;
}
/**
* Removes all the entries added into RecommendationCompliance.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation clearRecommendationComplianceEntries() {
this.recommendationCompliance = null;
return this;
}
/**
*
* Reference identifier for the recommendation configuration.
*
*
* @param referenceId
* Reference identifier for the recommendation configuration.
*/
public void setReferenceId(String referenceId) {
this.referenceId = referenceId;
}
/**
*
* Reference identifier for the recommendation configuration.
*
*
* @return Reference identifier for the recommendation configuration.
*/
public String getReferenceId() {
return this.referenceId;
}
/**
*
* Reference identifier for the recommendation configuration.
*
*
* @param referenceId
* Reference identifier for the recommendation configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withReferenceId(String referenceId) {
setReferenceId(referenceId);
return this;
}
/**
*
* List of the suggested configuration changes.
*
*
* @return List of the suggested configuration changes.
*/
public java.util.List getSuggestedChanges() {
return suggestedChanges;
}
/**
*
* List of the suggested configuration changes.
*
*
* @param suggestedChanges
* List of the suggested configuration changes.
*/
public void setSuggestedChanges(java.util.Collection suggestedChanges) {
if (suggestedChanges == null) {
this.suggestedChanges = null;
return;
}
this.suggestedChanges = new java.util.ArrayList(suggestedChanges);
}
/**
*
* List of the suggested configuration changes.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSuggestedChanges(java.util.Collection)} or {@link #withSuggestedChanges(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param suggestedChanges
* List of the suggested configuration changes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withSuggestedChanges(String... suggestedChanges) {
if (this.suggestedChanges == null) {
setSuggestedChanges(new java.util.ArrayList(suggestedChanges.length));
}
for (String ele : suggestedChanges) {
this.suggestedChanges.add(ele);
}
return this;
}
/**
*
* List of the suggested configuration changes.
*
*
* @param suggestedChanges
* List of the suggested configuration changes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRecommendation withSuggestedChanges(java.util.Collection suggestedChanges) {
setSuggestedChanges(suggestedChanges);
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 (getAppComponentName() != null)
sb.append("AppComponentName: ").append(getAppComponentName()).append(",");
if (getCompliance() != null)
sb.append("Compliance: ").append(getCompliance()).append(",");
if (getCost() != null)
sb.append("Cost: ").append(getCost()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getHaArchitecture() != null)
sb.append("HaArchitecture: ").append(getHaArchitecture()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getOptimizationType() != null)
sb.append("OptimizationType: ").append(getOptimizationType()).append(",");
if (getRecommendationCompliance() != null)
sb.append("RecommendationCompliance: ").append(getRecommendationCompliance()).append(",");
if (getReferenceId() != null)
sb.append("ReferenceId: ").append(getReferenceId()).append(",");
if (getSuggestedChanges() != null)
sb.append("SuggestedChanges: ").append(getSuggestedChanges());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ConfigRecommendation == false)
return false;
ConfigRecommendation other = (ConfigRecommendation) obj;
if (other.getAppComponentName() == null ^ this.getAppComponentName() == null)
return false;
if (other.getAppComponentName() != null && other.getAppComponentName().equals(this.getAppComponentName()) == false)
return false;
if (other.getCompliance() == null ^ this.getCompliance() == null)
return false;
if (other.getCompliance() != null && other.getCompliance().equals(this.getCompliance()) == false)
return false;
if (other.getCost() == null ^ this.getCost() == null)
return false;
if (other.getCost() != null && other.getCost().equals(this.getCost()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getHaArchitecture() == null ^ this.getHaArchitecture() == null)
return false;
if (other.getHaArchitecture() != null && other.getHaArchitecture().equals(this.getHaArchitecture()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getOptimizationType() == null ^ this.getOptimizationType() == null)
return false;
if (other.getOptimizationType() != null && other.getOptimizationType().equals(this.getOptimizationType()) == false)
return false;
if (other.getRecommendationCompliance() == null ^ this.getRecommendationCompliance() == null)
return false;
if (other.getRecommendationCompliance() != null && other.getRecommendationCompliance().equals(this.getRecommendationCompliance()) == false)
return false;
if (other.getReferenceId() == null ^ this.getReferenceId() == null)
return false;
if (other.getReferenceId() != null && other.getReferenceId().equals(this.getReferenceId()) == false)
return false;
if (other.getSuggestedChanges() == null ^ this.getSuggestedChanges() == null)
return false;
if (other.getSuggestedChanges() != null && other.getSuggestedChanges().equals(this.getSuggestedChanges()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAppComponentName() == null) ? 0 : getAppComponentName().hashCode());
hashCode = prime * hashCode + ((getCompliance() == null) ? 0 : getCompliance().hashCode());
hashCode = prime * hashCode + ((getCost() == null) ? 0 : getCost().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getHaArchitecture() == null) ? 0 : getHaArchitecture().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getOptimizationType() == null) ? 0 : getOptimizationType().hashCode());
hashCode = prime * hashCode + ((getRecommendationCompliance() == null) ? 0 : getRecommendationCompliance().hashCode());
hashCode = prime * hashCode + ((getReferenceId() == null) ? 0 : getReferenceId().hashCode());
hashCode = prime * hashCode + ((getSuggestedChanges() == null) ? 0 : getSuggestedChanges().hashCode());
return hashCode;
}
@Override
public ConfigRecommendation clone() {
try {
return (ConfigRecommendation) 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.resiliencehub.model.transform.ConfigRecommendationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}