Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 

The StatisticSet data type describes the StatisticValues component of MetricDatum, and represents a set of statistics that describes a specific metric.

 
 public class StatisticSet implements SerializableCloneable {

    
The number of samples used for the statistic set.
 
     private Double sampleCount;

    
The sum of values for the sample set.
 
     private Double sum;

    
The minimum value of the sample set.
 
     private Double minimum;

    
The maximum value of the sample set.
 
     private Double maximum;

    
The number of samples used for the statistic set.

Returns:
The number of samples used for the statistic set.
 
     public Double getSampleCount() {
         return ;
     }
    
    
The number of samples used for the statistic set.

Parameters:
sampleCount The number of samples used for the statistic set.
 
     public void setSampleCount(Double sampleCount) {
         this. = sampleCount;
     }
    
    
The number of samples used for the statistic set.

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

Parameters:
sampleCount The number of samples used for the statistic set.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public StatisticSet withSampleCount(Double sampleCount) {
         this. = sampleCount;
         return this;
     }

    
The sum of values for the sample set.

Returns:
The sum of values for the sample set.
 
     public Double getSum() {
         return ;
     }
    
    
The sum of values for the sample set.

Parameters:
sum The sum of values for the sample set.
 
     public void setSum(Double sum) {
         this. = sum;
     }
    
    
The sum of values for the sample set.

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

Parameters:
sum The sum of values for the sample set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StatisticSet withSum(Double sum) {
        this. = sum;
        return this;
    }

    
The minimum value of the sample set.

Returns:
The minimum value of the sample set.
    public Double getMinimum() {
        return ;
    }
    
    
The minimum value of the sample set.

Parameters:
minimum The minimum value of the sample set.
    public void setMinimum(Double minimum) {
        this. = minimum;
    }
    
    
The minimum value of the sample set.

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

Parameters:
minimum The minimum value of the sample set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StatisticSet withMinimum(Double minimum) {
        this. = minimum;
        return this;
    }

    
The maximum value of the sample set.

Returns:
The maximum value of the sample set.
    public Double getMaximum() {
        return ;
    }
    
    
The maximum value of the sample set.

Parameters:
maximum The maximum value of the sample set.
    public void setMaximum(Double maximum) {
        this. = maximum;
    }
    
    
The maximum value of the sample set.

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

Parameters:
maximum The maximum value of the sample set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public StatisticSet withMaximum(Double maximum) {
        this. = maximum;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSampleCount() != nullsb.append("SampleCount: " + getSampleCount() + ",");
        if (getSum() != nullsb.append("Sum: " + getSum() + ",");
        if (getMinimum() != nullsb.append("Minimum: " + getMinimum() + ",");
        if (getMaximum() != nullsb.append("Maximum: " + getMaximum() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSampleCount() == null) ? 0 : getSampleCount().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()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof StatisticSet == falsereturn false;
        StatisticSet other = (StatisticSet)obj;
        
        if (other.getSampleCount() == null ^ this.getSampleCount() == nullreturn false;
        if (other.getSampleCount() != null && other.getSampleCount().equals(this.getSampleCount()) == falsereturn false
        if (other.getSum() == null ^ this.getSum() == nullreturn false;
        if (other.getSum() != null && other.getSum().equals(this.getSum()) == falsereturn false
        if (other.getMinimum() == null ^ this.getMinimum() == nullreturn false;
        if (other.getMinimum() != null && other.getMinimum().equals(this.getMinimum()) == falsereturn false
        if (other.getMaximum() == null ^ this.getMaximum() == nullreturn false;
        if (other.getMaximum() != null && other.getMaximum().equals(this.getMaximum()) == falsereturn false
        return true;
    }
    
    @Override
    public StatisticSet clone() {
        try {
            return (StatisticSetsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X