/* * 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; /** *
* Details about a group of anomalous metrics. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AnomalyGroupSummary implements Serializable, Cloneable, StructuredPojo { /** ** The start time for the group. *
*/ private String startTime; /** ** The end time for the group. *
*/ private String endTime; /** ** The ID of the anomaly group. *
*/ private String anomalyGroupId; /** ** The severity score of the group. *
*/ private Double anomalyGroupScore; /** ** The name of the primary affected measure for the group. *
*/ private String primaryMetricName; /** ** The start time for the group. *
* * @param startTime * The start time for the group. */ public void setStartTime(String startTime) { this.startTime = startTime; } /** ** The start time for the group. *
* * @return The start time for the group. */ public String getStartTime() { return this.startTime; } /** ** The start time for the group. *
* * @param startTime * The start time for the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AnomalyGroupSummary withStartTime(String startTime) { setStartTime(startTime); return this; } /** ** The end time for the group. *
* * @param endTime * The end time for the group. */ public void setEndTime(String endTime) { this.endTime = endTime; } /** ** The end time for the group. *
* * @return The end time for the group. */ public String getEndTime() { return this.endTime; } /** ** The end time for the group. *
* * @param endTime * The end time for the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AnomalyGroupSummary withEndTime(String endTime) { setEndTime(endTime); return this; } /** ** The ID of the anomaly group. *
* * @param anomalyGroupId * The ID of the anomaly group. */ public void setAnomalyGroupId(String anomalyGroupId) { this.anomalyGroupId = anomalyGroupId; } /** ** The ID of the anomaly group. *
* * @return The ID of the anomaly group. */ public String getAnomalyGroupId() { return this.anomalyGroupId; } /** ** The ID of the anomaly group. *
* * @param anomalyGroupId * The ID of the anomaly group. * @return Returns a reference to this object so that method calls can be chained together. */ public AnomalyGroupSummary withAnomalyGroupId(String anomalyGroupId) { setAnomalyGroupId(anomalyGroupId); return this; } /** ** The severity score of the group. *
* * @param anomalyGroupScore * The severity score of the group. */ public void setAnomalyGroupScore(Double anomalyGroupScore) { this.anomalyGroupScore = anomalyGroupScore; } /** ** The severity score of the group. *
* * @return The severity score of the group. */ public Double getAnomalyGroupScore() { return this.anomalyGroupScore; } /** ** The severity score of the group. *
* * @param anomalyGroupScore * The severity score of the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AnomalyGroupSummary withAnomalyGroupScore(Double anomalyGroupScore) { setAnomalyGroupScore(anomalyGroupScore); return this; } /** ** The name of the primary affected measure for the group. *
* * @param primaryMetricName * The name of the primary affected measure for the group. */ public void setPrimaryMetricName(String primaryMetricName) { this.primaryMetricName = primaryMetricName; } /** ** The name of the primary affected measure for the group. *
* * @return The name of the primary affected measure for the group. */ public String getPrimaryMetricName() { return this.primaryMetricName; } /** ** The name of the primary affected measure for the group. *
* * @param primaryMetricName * The name of the primary affected measure for the group. * @return Returns a reference to this object so that method calls can be chained together. */ public AnomalyGroupSummary withPrimaryMetricName(String primaryMetricName) { setPrimaryMetricName(primaryMetricName); 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 (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getEndTime() != null) sb.append("EndTime: ").append(getEndTime()).append(","); if (getAnomalyGroupId() != null) sb.append("AnomalyGroupId: ").append(getAnomalyGroupId()).append(","); if (getAnomalyGroupScore() != null) sb.append("AnomalyGroupScore: ").append(getAnomalyGroupScore()).append(","); if (getPrimaryMetricName() != null) sb.append("PrimaryMetricName: ").append(getPrimaryMetricName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AnomalyGroupSummary == false) return false; AnomalyGroupSummary other = (AnomalyGroupSummary) obj; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false) return false; if (other.getAnomalyGroupId() == null ^ this.getAnomalyGroupId() == null) return false; if (other.getAnomalyGroupId() != null && other.getAnomalyGroupId().equals(this.getAnomalyGroupId()) == false) return false; if (other.getAnomalyGroupScore() == null ^ this.getAnomalyGroupScore() == null) return false; if (other.getAnomalyGroupScore() != null && other.getAnomalyGroupScore().equals(this.getAnomalyGroupScore()) == false) return false; if (other.getPrimaryMetricName() == null ^ this.getPrimaryMetricName() == null) return false; if (other.getPrimaryMetricName() != null && other.getPrimaryMetricName().equals(this.getPrimaryMetricName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getAnomalyGroupId() == null) ? 0 : getAnomalyGroupId().hashCode()); hashCode = prime * hashCode + ((getAnomalyGroupScore() == null) ? 0 : getAnomalyGroupScore().hashCode()); hashCode = prime * hashCode + ((getPrimaryMetricName() == null) ? 0 : getPrimaryMetricName().hashCode()); return hashCode; } @Override public AnomalyGroupSummary clone() { try { return (AnomalyGroupSummary) 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.AnomalyGroupSummaryMarshaller.getInstance().marshall(this, protocolMarshaller); } }