/* * 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.cloudwatch.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* This structure contains the configuration information about one metric stream. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class MetricStreamEntry implements Serializable, Cloneable { /** ** The ARN of the metric stream. *
*/ private String arn; /** ** The date that the metric stream was originally created. *
*/ private java.util.Date creationDate; /** ** The date that the configuration of this metric stream was most recently updated. *
*/ private java.util.Date lastUpdateDate; /** ** The name of the metric stream. *
*/ private String name; /** ** The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. *
*/ private String firehoseArn; /** *
* The current state of this stream. Valid values are running
and stopped
.
*
* The output format of this metric stream. Valid values are json
and opentelemetry0.7
.
*
* The ARN of the metric stream. *
* * @param arn * The ARN of the metric stream. */ public void setArn(String arn) { this.arn = arn; } /** ** The ARN of the metric stream. *
* * @return The ARN of the metric stream. */ public String getArn() { return this.arn; } /** ** The ARN of the metric stream. *
* * @param arn * The ARN of the metric stream. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricStreamEntry withArn(String arn) { setArn(arn); return this; } /** ** The date that the metric stream was originally created. *
* * @param creationDate * The date that the metric stream was originally created. */ public void setCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; } /** ** The date that the metric stream was originally created. *
* * @return The date that the metric stream was originally created. */ public java.util.Date getCreationDate() { return this.creationDate; } /** ** The date that the metric stream was originally created. *
* * @param creationDate * The date that the metric stream was originally created. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricStreamEntry withCreationDate(java.util.Date creationDate) { setCreationDate(creationDate); return this; } /** ** The date that the configuration of this metric stream was most recently updated. *
* * @param lastUpdateDate * The date that the configuration of this metric stream was most recently updated. */ public void setLastUpdateDate(java.util.Date lastUpdateDate) { this.lastUpdateDate = lastUpdateDate; } /** ** The date that the configuration of this metric stream was most recently updated. *
* * @return The date that the configuration of this metric stream was most recently updated. */ public java.util.Date getLastUpdateDate() { return this.lastUpdateDate; } /** ** The date that the configuration of this metric stream was most recently updated. *
* * @param lastUpdateDate * The date that the configuration of this metric stream was most recently updated. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricStreamEntry withLastUpdateDate(java.util.Date lastUpdateDate) { setLastUpdateDate(lastUpdateDate); return this; } /** ** The name of the metric stream. *
* * @param name * The name of the metric stream. */ public void setName(String name) { this.name = name; } /** ** The name of the metric stream. *
* * @return The name of the metric stream. */ public String getName() { return this.name; } /** ** The name of the metric stream. *
* * @param name * The name of the metric stream. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricStreamEntry withName(String name) { setName(name); return this; } /** ** The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. *
* * @param firehoseArn * The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. */ public void setFirehoseArn(String firehoseArn) { this.firehoseArn = firehoseArn; } /** ** The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. *
* * @return The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. */ public String getFirehoseArn() { return this.firehoseArn; } /** ** The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. *
* * @param firehoseArn * The ARN of the Kinesis Firehose devlivery stream that is used for this metric stream. * @return Returns a reference to this object so that method calls can be chained together. */ public MetricStreamEntry withFirehoseArn(String firehoseArn) { setFirehoseArn(firehoseArn); return this; } /** *
* The current state of this stream. Valid values are running
and stopped
.
*
running
and stopped
.
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The current state of this stream. Valid values are running
and stopped
.
*
running
and stopped
.
*/
public String getState() {
return this.state;
}
/**
*
* The current state of this stream. Valid values are running
and stopped
.
*
running
and stopped
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricStreamEntry withState(String state) {
setState(state);
return this;
}
/**
*
* The output format of this metric stream. Valid values are json
and opentelemetry0.7
.
*
json
and
* opentelemetry0.7
.
* @see MetricStreamOutputFormat
*/
public void setOutputFormat(String outputFormat) {
this.outputFormat = outputFormat;
}
/**
*
* The output format of this metric stream. Valid values are json
and opentelemetry0.7
.
*
json
and
* opentelemetry0.7
.
* @see MetricStreamOutputFormat
*/
public String getOutputFormat() {
return this.outputFormat;
}
/**
*
* The output format of this metric stream. Valid values are json
and opentelemetry0.7
.
*
json
and
* opentelemetry0.7
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MetricStreamOutputFormat
*/
public MetricStreamEntry withOutputFormat(String outputFormat) {
setOutputFormat(outputFormat);
return this;
}
/**
*
* The output format of this metric stream. Valid values are json
and opentelemetry0.7
.
*
json
and
* opentelemetry0.7
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MetricStreamOutputFormat
*/
public MetricStreamEntry withOutputFormat(MetricStreamOutputFormat outputFormat) {
this.outputFormat = outputFormat.toString();
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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getCreationDate() != null)
sb.append("CreationDate: ").append(getCreationDate()).append(",");
if (getLastUpdateDate() != null)
sb.append("LastUpdateDate: ").append(getLastUpdateDate()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getFirehoseArn() != null)
sb.append("FirehoseArn: ").append(getFirehoseArn()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getOutputFormat() != null)
sb.append("OutputFormat: ").append(getOutputFormat());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MetricStreamEntry == false)
return false;
MetricStreamEntry other = (MetricStreamEntry) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getCreationDate() == null ^ this.getCreationDate() == null)
return false;
if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false)
return false;
if (other.getLastUpdateDate() == null ^ this.getLastUpdateDate() == null)
return false;
if (other.getLastUpdateDate() != null && other.getLastUpdateDate().equals(this.getLastUpdateDate()) == 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.getFirehoseArn() == null ^ this.getFirehoseArn() == null)
return false;
if (other.getFirehoseArn() != null && other.getFirehoseArn().equals(this.getFirehoseArn()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getOutputFormat() == null ^ this.getOutputFormat() == null)
return false;
if (other.getOutputFormat() != null && other.getOutputFormat().equals(this.getOutputFormat()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode());
hashCode = prime * hashCode + ((getLastUpdateDate() == null) ? 0 : getLastUpdateDate().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getFirehoseArn() == null) ? 0 : getFirehoseArn().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getOutputFormat() == null) ? 0 : getOutputFormat().hashCode());
return hashCode;
}
@Override
public MetricStreamEntry clone() {
try {
return (MetricStreamEntry) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}