com.amazonaws.services.cloudwatch.model.MetricStreamStatisticsConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudwatch 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.cloudwatch.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* By default, a metric stream always sends the MAX
, MIN
, SUM
, and
* SAMPLECOUNT
statistics for each metric that is streamed. This structure contains information for one
* metric that includes additional statistics in the stream. For more information about statistics, see CloudWatch,
* listed in
* CloudWatch statistics definitions.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MetricStreamStatisticsConfiguration implements Serializable, Cloneable {
/**
*
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of the
* AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*
*/
private com.amazonaws.internal.SdkInternalList includeMetrics;
/**
*
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
*
* If the OutputFormat
for the stream is opentelemetry1.0
or opentelemetry0.7
* , the only valid values are p??
percentile statistics such as p90
,
* p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the abbreviations
* for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*
*/
private com.amazonaws.internal.SdkInternalList additionalStatistics;
/**
*
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of the
* AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*
*
* @return An array of metric name and namespace pairs that stream the additional statistics listed in the value of
* the AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*/
public java.util.List getIncludeMetrics() {
if (includeMetrics == null) {
includeMetrics = new com.amazonaws.internal.SdkInternalList();
}
return includeMetrics;
}
/**
*
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of the
* AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*
*
* @param includeMetrics
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of
* the AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*/
public void setIncludeMetrics(java.util.Collection includeMetrics) {
if (includeMetrics == null) {
this.includeMetrics = null;
return;
}
this.includeMetrics = new com.amazonaws.internal.SdkInternalList(includeMetrics);
}
/**
*
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of the
* AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setIncludeMetrics(java.util.Collection)} or {@link #withIncludeMetrics(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param includeMetrics
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of
* the AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricStreamStatisticsConfiguration withIncludeMetrics(MetricStreamStatisticsMetric... includeMetrics) {
if (this.includeMetrics == null) {
setIncludeMetrics(new com.amazonaws.internal.SdkInternalList(includeMetrics.length));
}
for (MetricStreamStatisticsMetric ele : includeMetrics) {
this.includeMetrics.add(ele);
}
return this;
}
/**
*
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of the
* AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
*
*
* @param includeMetrics
* An array of metric name and namespace pairs that stream the additional statistics listed in the value of
* the AdditionalStatistics
parameter. There can be as many as 100 pairs in the array.
*
* All metrics that match the combination of metric name and namespace will be streamed with the additional
* statistics, no matter their dimensions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricStreamStatisticsConfiguration withIncludeMetrics(java.util.Collection includeMetrics) {
setIncludeMetrics(includeMetrics);
return this;
}
/**
*
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
*
* If the OutputFormat
for the stream is opentelemetry1.0
or opentelemetry0.7
* , the only valid values are p??
percentile statistics such as p90
,
* p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the abbreviations
* for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*
*
* @return The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
* If the OutputFormat
for the stream is opentelemetry1.0
or
* opentelemetry0.7
, the only valid values are p??
percentile statistics
* such as p90
, p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the
* abbreviations for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*/
public java.util.List getAdditionalStatistics() {
if (additionalStatistics == null) {
additionalStatistics = new com.amazonaws.internal.SdkInternalList();
}
return additionalStatistics;
}
/**
*
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
*
* If the OutputFormat
for the stream is opentelemetry1.0
or opentelemetry0.7
* , the only valid values are p??
percentile statistics such as p90
,
* p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the abbreviations
* for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*
*
* @param additionalStatistics
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
* If the OutputFormat
for the stream is opentelemetry1.0
or
* opentelemetry0.7
, the only valid values are p??
percentile statistics
* such as p90
, p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the
* abbreviations for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*/
public void setAdditionalStatistics(java.util.Collection additionalStatistics) {
if (additionalStatistics == null) {
this.additionalStatistics = null;
return;
}
this.additionalStatistics = new com.amazonaws.internal.SdkInternalList(additionalStatistics);
}
/**
*
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
*
* If the OutputFormat
for the stream is opentelemetry1.0
or opentelemetry0.7
* , the only valid values are p??
percentile statistics such as p90
,
* p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the abbreviations
* for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAdditionalStatistics(java.util.Collection)} or {@link #withAdditionalStatistics(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param additionalStatistics
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
* If the OutputFormat
for the stream is opentelemetry1.0
or
* opentelemetry0.7
, the only valid values are p??
percentile statistics
* such as p90
, p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the
* abbreviations for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricStreamStatisticsConfiguration withAdditionalStatistics(String... additionalStatistics) {
if (this.additionalStatistics == null) {
setAdditionalStatistics(new com.amazonaws.internal.SdkInternalList(additionalStatistics.length));
}
for (String ele : additionalStatistics) {
this.additionalStatistics.add(ele);
}
return this;
}
/**
*
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
*
* If the OutputFormat
for the stream is opentelemetry1.0
or opentelemetry0.7
* , the only valid values are p??
percentile statistics such as p90
,
* p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the abbreviations
* for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
*
*
* @param additionalStatistics
* The list of additional statistics that are to be streamed for the metrics listed in the
* IncludeMetrics
array in this structure. This list can include as many as 20 statistics.
*
* If the OutputFormat
for the stream is opentelemetry1.0
or
* opentelemetry0.7
, the only valid values are p??
percentile statistics
* such as p90
, p99
and so on.
*
*
* If the OutputFormat
for the stream is json
, the valid values include the
* abbreviations for all of the statistics listed in
* CloudWatch statistics definitions. For example, this includes tm98,
wm90
,
* PR(:300)
, and so on.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricStreamStatisticsConfiguration withAdditionalStatistics(java.util.Collection additionalStatistics) {
setAdditionalStatistics(additionalStatistics);
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 (getIncludeMetrics() != null)
sb.append("IncludeMetrics: ").append(getIncludeMetrics()).append(",");
if (getAdditionalStatistics() != null)
sb.append("AdditionalStatistics: ").append(getAdditionalStatistics());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MetricStreamStatisticsConfiguration == false)
return false;
MetricStreamStatisticsConfiguration other = (MetricStreamStatisticsConfiguration) obj;
if (other.getIncludeMetrics() == null ^ this.getIncludeMetrics() == null)
return false;
if (other.getIncludeMetrics() != null && other.getIncludeMetrics().equals(this.getIncludeMetrics()) == false)
return false;
if (other.getAdditionalStatistics() == null ^ this.getAdditionalStatistics() == null)
return false;
if (other.getAdditionalStatistics() != null && other.getAdditionalStatistics().equals(this.getAdditionalStatistics()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIncludeMetrics() == null) ? 0 : getIncludeMetrics().hashCode());
hashCode = prime * hashCode + ((getAdditionalStatistics() == null) ? 0 : getAdditionalStatistics().hashCode());
return hashCode;
}
@Override
public MetricStreamStatisticsConfiguration clone() {
try {
return (MetricStreamStatisticsConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}