com.amazonaws.services.ioteventsdata.model.Alarm Maven / Gradle / Ivy
/*
 * Copyright 2020-2025 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.ioteventsdata.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
 * 
 * Contains information about an alarm.
 * 
 * 
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Alarm implements Serializable, Cloneable, StructuredPojo {
    /**
     * 
     * The name of the alarm model.
     * 
     */
    private String alarmModelName;
    /**
     * 
     * The version of the alarm model.
     * 
     */
    private String alarmModelVersion;
    /**
     * 
     * The value of the key used as a filter to select only the alarms associated with the key.
     * 
     */
    private String keyValue;
    /**
     * 
     * Contains information about the current state of the alarm.
     * 
     */
    private AlarmState alarmState;
    /**
     * 
     * A non-negative integer that reflects the severity level of the alarm.
     * 
     */
    private Integer severity;
    /**
     * 
     * The time the alarm was created, in the Unix epoch format.
     * 
     */
    private java.util.Date creationTime;
    /**
     * 
     * The time the alarm was last updated, in the Unix epoch format.
     * 
     */
    private java.util.Date lastUpdateTime;
    /**
     * 
     * The name of the alarm model.
     * 
     * 
     * @param alarmModelName
     *        The name of the alarm model.
     */
    public void setAlarmModelName(String alarmModelName) {
        this.alarmModelName = alarmModelName;
    }
    /**
     * 
     * The name of the alarm model.
     * 
     * 
     * @return The name of the alarm model.
     */
    public String getAlarmModelName() {
        return this.alarmModelName;
    }
    /**
     * 
     * The name of the alarm model.
     * 
     * 
     * @param alarmModelName
     *        The name of the alarm model.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withAlarmModelName(String alarmModelName) {
        setAlarmModelName(alarmModelName);
        return this;
    }
    /**
     * 
     * The version of the alarm model.
     * 
     * 
     * @param alarmModelVersion
     *        The version of the alarm model.
     */
    public void setAlarmModelVersion(String alarmModelVersion) {
        this.alarmModelVersion = alarmModelVersion;
    }
    /**
     * 
     * The version of the alarm model.
     * 
     * 
     * @return The version of the alarm model.
     */
    public String getAlarmModelVersion() {
        return this.alarmModelVersion;
    }
    /**
     * 
     * The version of the alarm model.
     * 
     * 
     * @param alarmModelVersion
     *        The version of the alarm model.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withAlarmModelVersion(String alarmModelVersion) {
        setAlarmModelVersion(alarmModelVersion);
        return this;
    }
    /**
     * 
     * The value of the key used as a filter to select only the alarms associated with the key.
     * 
     * 
     * @param keyValue
     *        The value of the key used as a filter to select only the alarms associated with the key.
     */
    public void setKeyValue(String keyValue) {
        this.keyValue = keyValue;
    }
    /**
     * 
     * The value of the key used as a filter to select only the alarms associated with the key.
     * 
     * 
     * @return The value of the key used as a filter to select only the alarms associated with the key.
     */
    public String getKeyValue() {
        return this.keyValue;
    }
    /**
     * 
     * The value of the key used as a filter to select only the alarms associated with the key.
     * 
     * 
     * @param keyValue
     *        The value of the key used as a filter to select only the alarms associated with the key.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withKeyValue(String keyValue) {
        setKeyValue(keyValue);
        return this;
    }
    /**
     * 
     * Contains information about the current state of the alarm.
     * 
     * 
     * @param alarmState
     *        Contains information about the current state of the alarm.
     */
    public void setAlarmState(AlarmState alarmState) {
        this.alarmState = alarmState;
    }
    /**
     * 
     * Contains information about the current state of the alarm.
     * 
     * 
     * @return Contains information about the current state of the alarm.
     */
    public AlarmState getAlarmState() {
        return this.alarmState;
    }
    /**
     * 
     * Contains information about the current state of the alarm.
     * 
     * 
     * @param alarmState
     *        Contains information about the current state of the alarm.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withAlarmState(AlarmState alarmState) {
        setAlarmState(alarmState);
        return this;
    }
    /**
     * 
     * A non-negative integer that reflects the severity level of the alarm.
     * 
     * 
     * @param severity
     *        A non-negative integer that reflects the severity level of the alarm.
     */
    public void setSeverity(Integer severity) {
        this.severity = severity;
    }
    /**
     * 
     * A non-negative integer that reflects the severity level of the alarm.
     * 
     * 
     * @return A non-negative integer that reflects the severity level of the alarm.
     */
    public Integer getSeverity() {
        return this.severity;
    }
    /**
     * 
     * A non-negative integer that reflects the severity level of the alarm.
     * 
     * 
     * @param severity
     *        A non-negative integer that reflects the severity level of the alarm.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withSeverity(Integer severity) {
        setSeverity(severity);
        return this;
    }
    /**
     * 
     * The time the alarm was created, in the Unix epoch format.
     * 
     * 
     * @param creationTime
     *        The time the alarm was created, in the Unix epoch format.
     */
    public void setCreationTime(java.util.Date creationTime) {
        this.creationTime = creationTime;
    }
    /**
     * 
     * The time the alarm was created, in the Unix epoch format.
     * 
     * 
     * @return The time the alarm was created, in the Unix epoch format.
     */
    public java.util.Date getCreationTime() {
        return this.creationTime;
    }
    /**
     * 
     * The time the alarm was created, in the Unix epoch format.
     * 
     * 
     * @param creationTime
     *        The time the alarm was created, in the Unix epoch format.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withCreationTime(java.util.Date creationTime) {
        setCreationTime(creationTime);
        return this;
    }
    /**
     * 
     * The time the alarm was last updated, in the Unix epoch format.
     * 
     * 
     * @param lastUpdateTime
     *        The time the alarm was last updated, in the Unix epoch format.
     */
    public void setLastUpdateTime(java.util.Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }
    /**
     * 
     * The time the alarm was last updated, in the Unix epoch format.
     * 
     * 
     * @return The time the alarm was last updated, in the Unix epoch format.
     */
    public java.util.Date getLastUpdateTime() {
        return this.lastUpdateTime;
    }
    /**
     * 
     * The time the alarm was last updated, in the Unix epoch format.
     * 
     * 
     * @param lastUpdateTime
     *        The time the alarm was last updated, in the Unix epoch format.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Alarm withLastUpdateTime(java.util.Date lastUpdateTime) {
        setLastUpdateTime(lastUpdateTime);
        return this;
    }
    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAlarmModelName() != null)
            sb.append("AlarmModelName: ").append(getAlarmModelName()).append(",");
        if (getAlarmModelVersion() != null)
            sb.append("AlarmModelVersion: ").append(getAlarmModelVersion()).append(",");
        if (getKeyValue() != null)
            sb.append("KeyValue: ").append(getKeyValue()).append(",");
        if (getAlarmState() != null)
            sb.append("AlarmState: ").append(getAlarmState()).append(",");
        if (getSeverity() != null)
            sb.append("Severity: ").append(getSeverity()).append(",");
        if (getCreationTime() != null)
            sb.append("CreationTime: ").append(getCreationTime()).append(",");
        if (getLastUpdateTime() != null)
            sb.append("LastUpdateTime: ").append(getLastUpdateTime());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof Alarm == false)
            return false;
        Alarm other = (Alarm) obj;
        if (other.getAlarmModelName() == null ^ this.getAlarmModelName() == null)
            return false;
        if (other.getAlarmModelName() != null && other.getAlarmModelName().equals(this.getAlarmModelName()) == false)
            return false;
        if (other.getAlarmModelVersion() == null ^ this.getAlarmModelVersion() == null)
            return false;
        if (other.getAlarmModelVersion() != null && other.getAlarmModelVersion().equals(this.getAlarmModelVersion()) == false)
            return false;
        if (other.getKeyValue() == null ^ this.getKeyValue() == null)
            return false;
        if (other.getKeyValue() != null && other.getKeyValue().equals(this.getKeyValue()) == false)
            return false;
        if (other.getAlarmState() == null ^ this.getAlarmState() == null)
            return false;
        if (other.getAlarmState() != null && other.getAlarmState().equals(this.getAlarmState()) == false)
            return false;
        if (other.getSeverity() == null ^ this.getSeverity() == null)
            return false;
        if (other.getSeverity() != null && other.getSeverity().equals(this.getSeverity()) == false)
            return false;
        if (other.getCreationTime() == null ^ this.getCreationTime() == null)
            return false;
        if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
            return false;
        if (other.getLastUpdateTime() == null ^ this.getLastUpdateTime() == null)
            return false;
        if (other.getLastUpdateTime() != null && other.getLastUpdateTime().equals(this.getLastUpdateTime()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getAlarmModelName() == null) ? 0 : getAlarmModelName().hashCode());
        hashCode = prime * hashCode + ((getAlarmModelVersion() == null) ? 0 : getAlarmModelVersion().hashCode());
        hashCode = prime * hashCode + ((getKeyValue() == null) ? 0 : getKeyValue().hashCode());
        hashCode = prime * hashCode + ((getAlarmState() == null) ? 0 : getAlarmState().hashCode());
        hashCode = prime * hashCode + ((getSeverity() == null) ? 0 : getSeverity().hashCode());
        hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        hashCode = prime * hashCode + ((getLastUpdateTime() == null) ? 0 : getLastUpdateTime().hashCode());
        return hashCode;
    }
    @Override
    public Alarm clone() {
        try {
            return (Alarm) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }
    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.ioteventsdata.model.transform.AlarmMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}