/* * 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; /** *

* A map of key-value pairs for all supported statistics. For issues with * missing or unexpected values for this API, consult Fleet indexing troubleshooting guide. *

*/ public class Statistics implements Serializable { /** *

* The count of things that match the query string criteria and contain a * valid aggregation field value. *

*/ private Integer count; /** *

* The average of the aggregated field values. *

*/ private Double average; /** *

* The sum of the aggregated field values. *

*/ private Double sum; /** *

* The minimum aggregated field value. *

*/ private Double minimum; /** *

* The maximum aggregated field value. *

*/ private Double maximum; /** *

* The sum of the squares of the aggregated field values. *

*/ private Double sumOfSquares; /** *

* The variance of the aggregated field values. *

*/ private Double variance; /** *

* The standard deviation of the aggregated field values. *

*/ private Double stdDeviation; /** *

* The count of things that match the query string criteria and contain a * valid aggregation field value. *

* * @return

* The count of things that match the query string criteria and * contain a valid aggregation field value. *

*/ public Integer getCount() { return count; } /** *

* The count of things that match the query string criteria and contain a * valid aggregation field value. *

* * @param count

* The count of things that match the query string criteria and * contain a valid aggregation field value. *

*/ public void setCount(Integer count) { this.count = count; } /** *

* The count of things that match the query string criteria and contain a * valid aggregation field value. *

*

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

* The count of things that match the query string criteria and * contain a valid aggregation field value. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withCount(Integer count) { this.count = count; return this; } /** *

* The average of the aggregated field values. *

* * @return

* The average of the aggregated field values. *

*/ public Double getAverage() { return average; } /** *

* The average of the aggregated field values. *

* * @param average

* The average of the aggregated field values. *

*/ public void setAverage(Double average) { this.average = average; } /** *

* The average of the aggregated field values. *

*

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

* The average of the aggregated field values. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withAverage(Double average) { this.average = average; return this; } /** *

* The sum of the aggregated field values. *

* * @return

* The sum of the aggregated field values. *

*/ public Double getSum() { return sum; } /** *

* The sum of the aggregated field values. *

* * @param sum

* The sum of the aggregated field values. *

*/ public void setSum(Double sum) { this.sum = sum; } /** *

* The sum of the aggregated field values. *

*

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

* The sum of the aggregated field values. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withSum(Double sum) { this.sum = sum; return this; } /** *

* The minimum aggregated field value. *

* * @return

* The minimum aggregated field value. *

*/ public Double getMinimum() { return minimum; } /** *

* The minimum aggregated field value. *

* * @param minimum

* The minimum aggregated field value. *

*/ public void setMinimum(Double minimum) { this.minimum = minimum; } /** *

* The minimum aggregated field value. *

*

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

* The minimum aggregated field value. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withMinimum(Double minimum) { this.minimum = minimum; return this; } /** *

* The maximum aggregated field value. *

* * @return

* The maximum aggregated field value. *

*/ public Double getMaximum() { return maximum; } /** *

* The maximum aggregated field value. *

* * @param maximum

* The maximum aggregated field value. *

*/ public void setMaximum(Double maximum) { this.maximum = maximum; } /** *

* The maximum aggregated field value. *

*

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

* The maximum aggregated field value. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withMaximum(Double maximum) { this.maximum = maximum; return this; } /** *

* The sum of the squares of the aggregated field values. *

* * @return

* The sum of the squares of the aggregated field values. *

*/ public Double getSumOfSquares() { return sumOfSquares; } /** *

* The sum of the squares of the aggregated field values. *

* * @param sumOfSquares

* The sum of the squares of the aggregated field values. *

*/ public void setSumOfSquares(Double sumOfSquares) { this.sumOfSquares = sumOfSquares; } /** *

* The sum of the squares of the aggregated field values. *

*

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

* The sum of the squares of the aggregated field values. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withSumOfSquares(Double sumOfSquares) { this.sumOfSquares = sumOfSquares; return this; } /** *

* The variance of the aggregated field values. *

* * @return

* The variance of the aggregated field values. *

*/ public Double getVariance() { return variance; } /** *

* The variance of the aggregated field values. *

* * @param variance

* The variance of the aggregated field values. *

*/ public void setVariance(Double variance) { this.variance = variance; } /** *

* The variance of the aggregated field values. *

*

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

* The variance of the aggregated field values. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withVariance(Double variance) { this.variance = variance; return this; } /** *

* The standard deviation of the aggregated field values. *

* * @return

* The standard deviation of the aggregated field values. *

*/ public Double getStdDeviation() { return stdDeviation; } /** *

* The standard deviation of the aggregated field values. *

* * @param stdDeviation

* The standard deviation of the aggregated field values. *

*/ public void setStdDeviation(Double stdDeviation) { this.stdDeviation = stdDeviation; } /** *

* The standard deviation of the aggregated field values. *

*

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

* The standard deviation of the aggregated field values. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Statistics withStdDeviation(Double stdDeviation) { this.stdDeviation = stdDeviation; 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 (getCount() != null) sb.append("count: " + getCount() + ","); if (getAverage() != null) sb.append("average: " + getAverage() + ","); if (getSum() != null) sb.append("sum: " + getSum() + ","); if (getMinimum() != null) sb.append("minimum: " + getMinimum() + ","); if (getMaximum() != null) sb.append("maximum: " + getMaximum() + ","); if (getSumOfSquares() != null) sb.append("sumOfSquares: " + getSumOfSquares() + ","); if (getVariance() != null) sb.append("variance: " + getVariance() + ","); if (getStdDeviation() != null) sb.append("stdDeviation: " + getStdDeviation()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCount() == null) ? 0 : getCount().hashCode()); hashCode = prime * hashCode + ((getAverage() == null) ? 0 : getAverage().hashCode()); hashCode = prime * hashCode + ((getSum() == null) ? 0 : getSum().hashCode()); hashCode = prime * hashCode + ((getMinimum() == null) ? 0 : getMinimum().hashCode()); hashCode = prime * hashCode + ((getMaximum() == null) ? 0 : getMaximum().hashCode()); hashCode = prime * hashCode + ((getSumOfSquares() == null) ? 0 : getSumOfSquares().hashCode()); hashCode = prime * hashCode + ((getVariance() == null) ? 0 : getVariance().hashCode()); hashCode = prime * hashCode + ((getStdDeviation() == null) ? 0 : getStdDeviation().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Statistics == false) return false; Statistics other = (Statistics) obj; if (other.getCount() == null ^ this.getCount() == null) return false; if (other.getCount() != null && other.getCount().equals(this.getCount()) == false) return false; if (other.getAverage() == null ^ this.getAverage() == null) return false; if (other.getAverage() != null && other.getAverage().equals(this.getAverage()) == false) return false; if (other.getSum() == null ^ this.getSum() == null) return false; if (other.getSum() != null && other.getSum().equals(this.getSum()) == false) return false; if (other.getMinimum() == null ^ this.getMinimum() == null) return false; if (other.getMinimum() != null && other.getMinimum().equals(this.getMinimum()) == false) return false; if (other.getMaximum() == null ^ this.getMaximum() == null) return false; if (other.getMaximum() != null && other.getMaximum().equals(this.getMaximum()) == false) return false; if (other.getSumOfSquares() == null ^ this.getSumOfSquares() == null) return false; if (other.getSumOfSquares() != null && other.getSumOfSquares().equals(this.getSumOfSquares()) == false) return false; if (other.getVariance() == null ^ this.getVariance() == null) return false; if (other.getVariance() != null && other.getVariance().equals(this.getVariance()) == false) return false; if (other.getStdDeviation() == null ^ this.getStdDeviation() == null) return false; if (other.getStdDeviation() != null && other.getStdDeviation().equals(this.getStdDeviation()) == false) return false; return true; } }