com.amazonaws.services.resiliencehub.model.ResiliencyScore 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;
/**
*
* The overall resiliency score, returned as an object that includes the disruption score and outage score.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResiliencyScore implements Serializable, Cloneable, StructuredPojo {
/**
*
* The score generated by Resilience Hub for the scoring component after running an assessment.
*
*
* For example, if the score
is 25 points, it indicates the overall score of your application generated
* by Resilience Hub after running an assessment.
*
*/
private java.util.Map componentScore;
/**
*
* The disruption score for a valid key.
*
*/
private java.util.Map disruptionScore;
/**
*
* The outage score for a valid key.
*
*/
private Double score;
/**
*
* The score generated by Resilience Hub for the scoring component after running an assessment.
*
*
* For example, if the score
is 25 points, it indicates the overall score of your application generated
* by Resilience Hub after running an assessment.
*
*
* @return The score generated by Resilience Hub for the scoring component after running an assessment.
*
* For example, if the score
is 25 points, it indicates the overall score of your application
* generated by Resilience Hub after running an assessment.
*/
public java.util.Map getComponentScore() {
return componentScore;
}
/**
*
* The score generated by Resilience Hub for the scoring component after running an assessment.
*
*
* For example, if the score
is 25 points, it indicates the overall score of your application generated
* by Resilience Hub after running an assessment.
*
*
* @param componentScore
* The score generated by Resilience Hub for the scoring component after running an assessment.
*
* For example, if the score
is 25 points, it indicates the overall score of your application
* generated by Resilience Hub after running an assessment.
*/
public void setComponentScore(java.util.Map componentScore) {
this.componentScore = componentScore;
}
/**
*
* The score generated by Resilience Hub for the scoring component after running an assessment.
*
*
* For example, if the score
is 25 points, it indicates the overall score of your application generated
* by Resilience Hub after running an assessment.
*
*
* @param componentScore
* The score generated by Resilience Hub for the scoring component after running an assessment.
*
* For example, if the score
is 25 points, it indicates the overall score of your application
* generated by Resilience Hub after running an assessment.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore withComponentScore(java.util.Map componentScore) {
setComponentScore(componentScore);
return this;
}
/**
* Add a single ComponentScore entry
*
* @see ResiliencyScore#withComponentScore
* @returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore addComponentScoreEntry(String key, ScoringComponentResiliencyScore value) {
if (null == this.componentScore) {
this.componentScore = new java.util.HashMap();
}
if (this.componentScore.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.componentScore.put(key, value);
return this;
}
/**
* Removes all the entries added into ComponentScore.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore clearComponentScoreEntries() {
this.componentScore = null;
return this;
}
/**
*
* The disruption score for a valid key.
*
*
* @return The disruption score for a valid key.
*/
public java.util.Map getDisruptionScore() {
return disruptionScore;
}
/**
*
* The disruption score for a valid key.
*
*
* @param disruptionScore
* The disruption score for a valid key.
*/
public void setDisruptionScore(java.util.Map disruptionScore) {
this.disruptionScore = disruptionScore;
}
/**
*
* The disruption score for a valid key.
*
*
* @param disruptionScore
* The disruption score for a valid key.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore withDisruptionScore(java.util.Map disruptionScore) {
setDisruptionScore(disruptionScore);
return this;
}
/**
* Add a single DisruptionScore entry
*
* @see ResiliencyScore#withDisruptionScore
* @returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore addDisruptionScoreEntry(String key, Double value) {
if (null == this.disruptionScore) {
this.disruptionScore = new java.util.HashMap();
}
if (this.disruptionScore.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.disruptionScore.put(key, value);
return this;
}
/**
* Removes all the entries added into DisruptionScore.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore clearDisruptionScoreEntries() {
this.disruptionScore = null;
return this;
}
/**
*
* The outage score for a valid key.
*
*
* @param score
* The outage score for a valid key.
*/
public void setScore(Double score) {
this.score = score;
}
/**
*
* The outage score for a valid key.
*
*
* @return The outage score for a valid key.
*/
public Double getScore() {
return this.score;
}
/**
*
* The outage score for a valid key.
*
*
* @param score
* The outage score for a valid key.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResiliencyScore withScore(Double score) {
setScore(score);
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 (getComponentScore() != null)
sb.append("ComponentScore: ").append(getComponentScore()).append(",");
if (getDisruptionScore() != null)
sb.append("DisruptionScore: ").append(getDisruptionScore()).append(",");
if (getScore() != null)
sb.append("Score: ").append(getScore());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResiliencyScore == false)
return false;
ResiliencyScore other = (ResiliencyScore) obj;
if (other.getComponentScore() == null ^ this.getComponentScore() == null)
return false;
if (other.getComponentScore() != null && other.getComponentScore().equals(this.getComponentScore()) == false)
return false;
if (other.getDisruptionScore() == null ^ this.getDisruptionScore() == null)
return false;
if (other.getDisruptionScore() != null && other.getDisruptionScore().equals(this.getDisruptionScore()) == false)
return false;
if (other.getScore() == null ^ this.getScore() == null)
return false;
if (other.getScore() != null && other.getScore().equals(this.getScore()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getComponentScore() == null) ? 0 : getComponentScore().hashCode());
hashCode = prime * hashCode + ((getDisruptionScore() == null) ? 0 : getDisruptionScore().hashCode());
hashCode = prime * hashCode + ((getScore() == null) ? 0 : getScore().hashCode());
return hashCode;
}
@Override
public ResiliencyScore clone() {
try {
return (ResiliencyScore) 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.ResiliencyScoreMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}