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;
 
 
Container for the parameters to the DescribeAlarmHistory operation.

Retrieves history for the specified alarm. Filter alarms by date range or item type. If an alarm name is not specified, Amazon CloudWatch returns histories for all of the owner's alarms.

NOTE: Amazon CloudWatch retains the history of an alarm for two weeks, whether or not you delete the alarm.

 
 public class DescribeAlarmHistoryRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the alarm.

Constraints:
Length: 1 - 255

 
     private String alarmName;

    
The type of alarm histories to retrieve.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

 
     private String historyItemType;

    
The starting date to retrieve alarm history.
 
     private java.util.Date startDate;

    
The ending date to retrieve alarm history.
 
     private java.util.Date endDate;

    
The maximum number of alarm history records to retrieve.

Constraints:
Range: 1 - 100

 
     private Integer maxRecords;

    
The token returned by a previous call to indicate that there is more data available.
 
     private String nextToken;

    
The name of the alarm.

Constraints:
Length: 1 - 255

Returns:
The name of the alarm.
 
     public String getAlarmName() {
         return ;
     }
    
    
The name of the alarm.

Constraints:
Length: 1 - 255

Parameters:
alarmName The name of the alarm.
 
     public void setAlarmName(String alarmName) {
         this. = alarmName;
     }
    
    
The name of the alarm.

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

Constraints:
Length: 1 - 255

Parameters:
alarmName The name of the alarm.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeAlarmHistoryRequest withAlarmName(String alarmName) {
        this. = alarmName;
        return this;
    }

    
The type of alarm histories to retrieve.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

Returns:
The type of alarm histories to retrieve.
See also:
HistoryItemType
    public String getHistoryItemType() {
        return ;
    }
    
    
The type of alarm histories to retrieve.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

Parameters:
historyItemType The type of alarm histories to retrieve.
See also:
HistoryItemType
    public void setHistoryItemType(String historyItemType) {
        this. = historyItemType;
    }
    
    
The type of alarm histories to retrieve.

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

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

Parameters:
historyItemType The type of alarm histories to retrieve.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
HistoryItemType
    public DescribeAlarmHistoryRequest withHistoryItemType(String historyItemType) {
        this. = historyItemType;
        return this;
    }

    
The type of alarm histories to retrieve.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

Parameters:
historyItemType The type of alarm histories to retrieve.
See also:
HistoryItemType
    public void setHistoryItemType(HistoryItemType historyItemType) {
        this. = historyItemType.toString();
    }
    
    
The type of alarm histories to retrieve.

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

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

Parameters:
historyItemType The type of alarm histories to retrieve.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
HistoryItemType
        this. = historyItemType.toString();
        return this;
    }

    
The starting date to retrieve alarm history.

Returns:
The starting date to retrieve alarm history.
    public java.util.Date getStartDate() {
        return ;
    }
    
    
The starting date to retrieve alarm history.

Parameters:
startDate The starting date to retrieve alarm history.
    public void setStartDate(java.util.Date startDate) {
        this. = startDate;
    }
    
    
The starting date to retrieve alarm history.

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

Parameters:
startDate The starting date to retrieve alarm history.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = startDate;
        return this;
    }

    
The ending date to retrieve alarm history.

Returns:
The ending date to retrieve alarm history.
    public java.util.Date getEndDate() {
        return ;
    }
    
    
The ending date to retrieve alarm history.

Parameters:
endDate The ending date to retrieve alarm history.
    public void setEndDate(java.util.Date endDate) {
        this. = endDate;
    }
    
    
The ending date to retrieve alarm history.

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

Parameters:
endDate The ending date to retrieve alarm history.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = endDate;
        return this;
    }

    
The maximum number of alarm history records to retrieve.

Constraints:
Range: 1 - 100

Returns:
The maximum number of alarm history records to retrieve.
    public Integer getMaxRecords() {
        return ;
    }
    
    
The maximum number of alarm history records to retrieve.

Constraints:
Range: 1 - 100

Parameters:
maxRecords The maximum number of alarm history records to retrieve.
    public void setMaxRecords(Integer maxRecords) {
        this. = maxRecords;
    }
    
    
The maximum number of alarm history records to retrieve.

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

Constraints:
Range: 1 - 100

Parameters:
maxRecords The maximum number of alarm history records to retrieve.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeAlarmHistoryRequest withMaxRecords(Integer maxRecords) {
        this. = maxRecords;
        return this;
    }

    
The token returned by a previous call to indicate that there is more data available.

Returns:
The token returned by a previous call to indicate that there is more data available.
    public String getNextToken() {
        return ;
    }
    
    
The token returned by a previous call to indicate that there is more data available.

Parameters:
nextToken The token returned by a previous call to indicate that there is more data available.
    public void setNextToken(String nextToken) {
        this. = nextToken;
    }
    
    
The token returned by a previous call to indicate that there is more data available.

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

Parameters:
nextToken The token returned by a previous call to indicate that there is more data available.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DescribeAlarmHistoryRequest withNextToken(String nextToken) {
        this. = nextToken;
        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 (getAlarmName() != nullsb.append("AlarmName: " + getAlarmName() + ",");
        if (getHistoryItemType() != nullsb.append("HistoryItemType: " + getHistoryItemType() + ",");
        if (getStartDate() != nullsb.append("StartDate: " + getStartDate() + ",");
        if (getEndDate() != nullsb.append("EndDate: " + getEndDate() + ",");
        if (getMaxRecords() != nullsb.append("MaxRecords: " + getMaxRecords() + ",");
        if (getNextToken() != nullsb.append("NextToken: " + getNextToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAlarmName() == null) ? 0 : getAlarmName().hashCode()); 
        hashCode = prime * hashCode + ((getHistoryItemType() == null) ? 0 : getHistoryItemType().hashCode()); 
        hashCode = prime * hashCode + ((getStartDate() == null) ? 0 : getStartDate().hashCode()); 
        hashCode = prime * hashCode + ((getEndDate() == null) ? 0 : getEndDate().hashCode()); 
        hashCode = prime * hashCode + ((getMaxRecords() == null) ? 0 : getMaxRecords().hashCode()); 
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DescribeAlarmHistoryRequest == falsereturn false;
        
        if (other.getAlarmName() == null ^ this.getAlarmName() == nullreturn false;
        if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == falsereturn false
        if (other.getHistoryItemType() == null ^ this.getHistoryItemType() == nullreturn false;
        if (other.getHistoryItemType() != null && other.getHistoryItemType().equals(this.getHistoryItemType()) == falsereturn false
        if (other.getStartDate() == null ^ this.getStartDate() == nullreturn false;
        if (other.getStartDate() != null && other.getStartDate().equals(this.getStartDate()) == falsereturn false
        if (other.getEndDate() == null ^ this.getEndDate() == nullreturn false;
        if (other.getEndDate() != null && other.getEndDate().equals(this.getEndDate()) == falsereturn false
        if (other.getMaxRecords() == null ^ this.getMaxRecords() == nullreturn false;
        if (other.getMaxRecords() != null && other.getMaxRecords().equals(this.getMaxRecords()) == falsereturn false
        if (other.getNextToken() == null ^ this.getNextToken() == nullreturn false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (DescribeAlarmHistoryRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X