/* * 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.lookoutmetrics.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The severity of a value of a dimension that contributed to an anomaly. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DimensionValueContribution implements Serializable, Cloneable, StructuredPojo { /** ** The value of the dimension. *
*/ private String dimensionValue; /** ** The severity score of the value. *
*/ private Double contributionScore; /** ** The value of the dimension. *
* * @param dimensionValue * The value of the dimension. */ public void setDimensionValue(String dimensionValue) { this.dimensionValue = dimensionValue; } /** ** The value of the dimension. *
* * @return The value of the dimension. */ public String getDimensionValue() { return this.dimensionValue; } /** ** The value of the dimension. *
* * @param dimensionValue * The value of the dimension. * @return Returns a reference to this object so that method calls can be chained together. */ public DimensionValueContribution withDimensionValue(String dimensionValue) { setDimensionValue(dimensionValue); return this; } /** ** The severity score of the value. *
* * @param contributionScore * The severity score of the value. */ public void setContributionScore(Double contributionScore) { this.contributionScore = contributionScore; } /** ** The severity score of the value. *
* * @return The severity score of the value. */ public Double getContributionScore() { return this.contributionScore; } /** ** The severity score of the value. *
* * @param contributionScore * The severity score of the value. * @return Returns a reference to this object so that method calls can be chained together. */ public DimensionValueContribution withContributionScore(Double contributionScore) { setContributionScore(contributionScore); 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 (getDimensionValue() != null) sb.append("DimensionValue: ").append(getDimensionValue()).append(","); if (getContributionScore() != null) sb.append("ContributionScore: ").append(getContributionScore()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DimensionValueContribution == false) return false; DimensionValueContribution other = (DimensionValueContribution) obj; if (other.getDimensionValue() == null ^ this.getDimensionValue() == null) return false; if (other.getDimensionValue() != null && other.getDimensionValue().equals(this.getDimensionValue()) == false) return false; if (other.getContributionScore() == null ^ this.getContributionScore() == null) return false; if (other.getContributionScore() != null && other.getContributionScore().equals(this.getContributionScore()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDimensionValue() == null) ? 0 : getDimensionValue().hashCode()); hashCode = prime * hashCode + ((getContributionScore() == null) ? 0 : getContributionScore().hashCode()); return hashCode; } @Override public DimensionValueContribution clone() { try { return (DimensionValueContribution) 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.lookoutmetrics.model.transform.DimensionValueContributionMarshaller.getInstance().marshall(this, protocolMarshaller); } }