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 AlarmHistoryItem data type contains descriptive information about the history of a specific alarm. If you call DescribeAlarmHistory, Amazon CloudWatch returns this data type as part of the DescribeAlarmHistoryResult data type.

 
 public class AlarmHistoryItem implements SerializableCloneable {

    
The descriptive name for the alarm.

Constraints:
Length: 1 - 255

 
     private String alarmName;

    
The time stamp for the alarm history item.
 
     private java.util.Date timestamp;

    
The type of alarm history item.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

 
     private String historyItemType;

    
A human-readable summary of the alarm history.

Constraints:
Length: 1 - 255

 
     private String historySummary;

    
Machine-readable data about the alarm in JSON format.

Constraints:
Length: 1 - 4095

 
     private String historyData;

    
The descriptive name for the alarm.

Constraints:
Length: 1 - 255

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

Constraints:
Length: 1 - 255

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

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

Constraints:
Length: 1 - 255

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

    
The time stamp for the alarm history item.

Returns:
The time stamp for the alarm history item.
    public java.util.Date getTimestamp() {
        return ;
    }
    
    
The time stamp for the alarm history item.

Parameters:
timestamp The time stamp for the alarm history item.
    public void setTimestamp(java.util.Date timestamp) {
        this. = timestamp;
    }
    
    
The time stamp for the alarm history item.

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

Parameters:
timestamp The time stamp for the alarm history item.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AlarmHistoryItem withTimestamp(java.util.Date timestamp) {
        this. = timestamp;
        return this;
    }

    
The type of alarm history item.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

Returns:
The type of alarm history item.
See also:
HistoryItemType
    public String getHistoryItemType() {
        return ;
    }
    
    
The type of alarm history item.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

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

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 history item.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
HistoryItemType
    public AlarmHistoryItem withHistoryItemType(String historyItemType) {
        this. = historyItemType;
        return this;
    }

    
The type of alarm history item.

Constraints:
Allowed Values: ConfigurationUpdate, StateUpdate, Action

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

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 history item.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
HistoryItemType
    public AlarmHistoryItem withHistoryItemType(HistoryItemType historyItemType) {
        this. = historyItemType.toString();
        return this;
    }

    
A human-readable summary of the alarm history.

Constraints:
Length: 1 - 255

Returns:
A human-readable summary of the alarm history.
    public String getHistorySummary() {
        return ;
    }
    
    
A human-readable summary of the alarm history.

Constraints:
Length: 1 - 255

Parameters:
historySummary A human-readable summary of the alarm history.
    public void setHistorySummary(String historySummary) {
        this. = historySummary;
    }
    
    
A human-readable summary of the alarm history.

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

Constraints:
Length: 1 - 255

Parameters:
historySummary A human-readable summary of the alarm history.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AlarmHistoryItem withHistorySummary(String historySummary) {
        this. = historySummary;
        return this;
    }

    
Machine-readable data about the alarm in JSON format.

Constraints:
Length: 1 - 4095

Returns:
Machine-readable data about the alarm in JSON format.
    public String getHistoryData() {
        return ;
    }
    
    
Machine-readable data about the alarm in JSON format.

Constraints:
Length: 1 - 4095

Parameters:
historyData Machine-readable data about the alarm in JSON format.
    public void setHistoryData(String historyData) {
        this. = historyData;
    }
    
    
Machine-readable data about the alarm in JSON format.

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

Constraints:
Length: 1 - 4095

Parameters:
historyData Machine-readable data about the alarm in JSON format.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AlarmHistoryItem withHistoryData(String historyData) {
        this. = historyData;
        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 (getTimestamp() != nullsb.append("Timestamp: " + getTimestamp() + ",");
        if (getHistoryItemType() != nullsb.append("HistoryItemType: " + getHistoryItemType() + ",");
        if (getHistorySummary() != nullsb.append("HistorySummary: " + getHistorySummary() + ",");
        if (getHistoryData() != nullsb.append("HistoryData: " + getHistoryData() );
        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 + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); 
        hashCode = prime * hashCode + ((getHistoryItemType() == null) ? 0 : getHistoryItemType().hashCode()); 
        hashCode = prime * hashCode + ((getHistorySummary() == null) ? 0 : getHistorySummary().hashCode()); 
        hashCode = prime * hashCode + ((getHistoryData() == null) ? 0 : getHistoryData().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof AlarmHistoryItem == falsereturn false;
        AlarmHistoryItem other = (AlarmHistoryItem)obj;
        
        if (other.getAlarmName() == null ^ this.getAlarmName() == nullreturn false;
        if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == falsereturn false
        if (other.getTimestamp() == null ^ this.getTimestamp() == nullreturn false;
        if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == falsereturn false
        if (other.getHistoryItemType() == null ^ this.getHistoryItemType() == nullreturn false;
        if (other.getHistoryItemType() != null && other.getHistoryItemType().equals(this.getHistoryItemType()) == falsereturn false
        if (other.getHistorySummary() == null ^ this.getHistorySummary() == nullreturn false;
        if (other.getHistorySummary() != null && other.getHistorySummary().equals(this.getHistorySummary()) == falsereturn false
        if (other.getHistoryData() == null ^ this.getHistoryData() == nullreturn false;
        if (other.getHistoryData() != null && other.getHistoryData().equals(this.getHistoryData()) == falsereturn false
        return true;
    }
    
    @Override
    public AlarmHistoryItem clone() {
        try {
            return (AlarmHistoryItemsuper.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