/* * Copyright 2010-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.iot.model; import java.io.Serializable; public class UpdateCustomMetricResult implements Serializable { /** *

* The name of the custom metric. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*/ private String metricName; /** *

* The Amazon Resource Number (ARN) of the custom metric. *

*/ private String metricArn; /** *

* The type of the custom metric. *

* *

* The type number only takes a single metric value as an * input, but while submitting the metrics value in the DeviceMetrics * report, it must be passed as an array with a single value. *

*
*

* Constraints:
* Allowed Values: string-list, ip-address-list, number-list, number */ private String metricType; /** *

* A friendly name in the console for the custom metric *

*

* Constraints:
* Length: - 128
* Pattern: [\p{Graph}\x20]*
*/ private String displayName; /** *

* The creation date of the custom metric in milliseconds since epoch. *

*/ private java.util.Date creationDate; /** *

* The time the custom metric was last modified in milliseconds since epoch. *

*/ private java.util.Date lastModifiedDate; /** *

* The name of the custom metric. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the custom metric. *

*/ public String getMetricName() { return metricName; } /** *

* The name of the custom metric. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @param metricName

* The name of the custom metric. *

*/ public void setMetricName(String metricName) { this.metricName = metricName; } /** *

* The name of the custom metric. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @param metricName

* The name of the custom metric. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateCustomMetricResult withMetricName(String metricName) { this.metricName = metricName; return this; } /** *

* The Amazon Resource Number (ARN) of the custom metric. *

* * @return

* The Amazon Resource Number (ARN) of the custom metric. *

*/ public String getMetricArn() { return metricArn; } /** *

* The Amazon Resource Number (ARN) of the custom metric. *

* * @param metricArn

* The Amazon Resource Number (ARN) of the custom metric. *

*/ public void setMetricArn(String metricArn) { this.metricArn = metricArn; } /** *

* The Amazon Resource Number (ARN) of the custom metric. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param metricArn

* The Amazon Resource Number (ARN) of the custom metric. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateCustomMetricResult withMetricArn(String metricArn) { this.metricArn = metricArn; return this; } /** *

* The type of the custom metric. *

* *

* The type number only takes a single metric value as an * input, but while submitting the metrics value in the DeviceMetrics * report, it must be passed as an array with a single value. *

*
*

* Constraints:
* Allowed Values: string-list, ip-address-list, number-list, number * * @return

* The type of the custom metric. *

* *

* The type number only takes a single metric value as * an input, but while submitting the metrics value in the * DeviceMetrics report, it must be passed as an array with a single * value. *

*
* @see CustomMetricType */ public String getMetricType() { return metricType; } /** *

* The type of the custom metric. *

* *

* The type number only takes a single metric value as an * input, but while submitting the metrics value in the DeviceMetrics * report, it must be passed as an array with a single value. *

*
*

* Constraints:
* Allowed Values: string-list, ip-address-list, number-list, number * * @param metricType

* The type of the custom metric. *

* *

* The type number only takes a single metric value * as an input, but while submitting the metrics value in the * DeviceMetrics report, it must be passed as an array with a * single value. *

*
* @see CustomMetricType */ public void setMetricType(String metricType) { this.metricType = metricType; } /** *

* The type of the custom metric. *

* *

* The type number only takes a single metric value as an * input, but while submitting the metrics value in the DeviceMetrics * report, it must be passed as an array with a single value. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: string-list, ip-address-list, number-list, number * * @param metricType

* The type of the custom metric. *

* *

* The type number only takes a single metric value * as an input, but while submitting the metrics value in the * DeviceMetrics report, it must be passed as an array with a * single value. *

*
* @return A reference to this updated object so that method calls can be * chained together. * @see CustomMetricType */ public UpdateCustomMetricResult withMetricType(String metricType) { this.metricType = metricType; return this; } /** *

* The type of the custom metric. *

* *

* The type number only takes a single metric value as an * input, but while submitting the metrics value in the DeviceMetrics * report, it must be passed as an array with a single value. *

*
*

* Constraints:
* Allowed Values: string-list, ip-address-list, number-list, number * * @param metricType

* The type of the custom metric. *

* *

* The type number only takes a single metric value * as an input, but while submitting the metrics value in the * DeviceMetrics report, it must be passed as an array with a * single value. *

*
* @see CustomMetricType */ public void setMetricType(CustomMetricType metricType) { this.metricType = metricType.toString(); } /** *

* The type of the custom metric. *

* *

* The type number only takes a single metric value as an * input, but while submitting the metrics value in the DeviceMetrics * report, it must be passed as an array with a single value. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: string-list, ip-address-list, number-list, number * * @param metricType

* The type of the custom metric. *

* *

* The type number only takes a single metric value * as an input, but while submitting the metrics value in the * DeviceMetrics report, it must be passed as an array with a * single value. *

*
* @return A reference to this updated object so that method calls can be * chained together. * @see CustomMetricType */ public UpdateCustomMetricResult withMetricType(CustomMetricType metricType) { this.metricType = metricType.toString(); return this; } /** *

* A friendly name in the console for the custom metric *

*

* Constraints:
* Length: - 128
* Pattern: [\p{Graph}\x20]*
* * @return

* A friendly name in the console for the custom metric *

*/ public String getDisplayName() { return displayName; } /** *

* A friendly name in the console for the custom metric *

*

* Constraints:
* Length: - 128
* Pattern: [\p{Graph}\x20]*
* * @param displayName

* A friendly name in the console for the custom metric *

*/ public void setDisplayName(String displayName) { this.displayName = displayName; } /** *

* A friendly name in the console for the custom metric *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: - 128
* Pattern: [\p{Graph}\x20]*
* * @param displayName

* A friendly name in the console for the custom metric *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateCustomMetricResult withDisplayName(String displayName) { this.displayName = displayName; return this; } /** *

* The creation date of the custom metric in milliseconds since epoch. *

* * @return

* The creation date of the custom metric in milliseconds since * epoch. *

*/ public java.util.Date getCreationDate() { return creationDate; } /** *

* The creation date of the custom metric in milliseconds since epoch. *

* * @param creationDate

* The creation date of the custom metric in milliseconds since * epoch. *

*/ public void setCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; } /** *

* The creation date of the custom metric in milliseconds since epoch. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param creationDate

* The creation date of the custom metric in milliseconds since * epoch. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateCustomMetricResult withCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; return this; } /** *

* The time the custom metric was last modified in milliseconds since epoch. *

* * @return

* The time the custom metric was last modified in milliseconds * since epoch. *

*/ public java.util.Date getLastModifiedDate() { return lastModifiedDate; } /** *

* The time the custom metric was last modified in milliseconds since epoch. *

* * @param lastModifiedDate

* The time the custom metric was last modified in milliseconds * since epoch. *

*/ public void setLastModifiedDate(java.util.Date lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } /** *

* The time the custom metric was last modified in milliseconds since epoch. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param lastModifiedDate

* The time the custom metric was last modified in milliseconds * since epoch. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateCustomMetricResult withLastModifiedDate(java.util.Date lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getMetricName() != null) sb.append("metricName: " + getMetricName() + ","); if (getMetricArn() != null) sb.append("metricArn: " + getMetricArn() + ","); if (getMetricType() != null) sb.append("metricType: " + getMetricType() + ","); if (getDisplayName() != null) sb.append("displayName: " + getDisplayName() + ","); if (getCreationDate() != null) sb.append("creationDate: " + getCreationDate() + ","); if (getLastModifiedDate() != null) sb.append("lastModifiedDate: " + getLastModifiedDate()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getMetricArn() == null) ? 0 : getMetricArn().hashCode()); hashCode = prime * hashCode + ((getMetricType() == null) ? 0 : getMetricType().hashCode()); hashCode = prime * hashCode + ((getDisplayName() == null) ? 0 : getDisplayName().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); hashCode = prime * hashCode + ((getLastModifiedDate() == null) ? 0 : getLastModifiedDate().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateCustomMetricResult == false) return false; UpdateCustomMetricResult other = (UpdateCustomMetricResult) obj; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getMetricArn() == null ^ this.getMetricArn() == null) return false; if (other.getMetricArn() != null && other.getMetricArn().equals(this.getMetricArn()) == false) return false; if (other.getMetricType() == null ^ this.getMetricType() == null) return false; if (other.getMetricType() != null && other.getMetricType().equals(this.getMetricType()) == false) return false; if (other.getDisplayName() == null ^ this.getDisplayName() == null) return false; if (other.getDisplayName() != null && other.getDisplayName().equals(this.getDisplayName()) == 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.getLastModifiedDate() == null ^ this.getLastModifiedDate() == null) return false; if (other.getLastModifiedDate() != null && other.getLastModifiedDate().equals(this.getLastModifiedDate()) == false) return false; return true; } }