/* * 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; /** *
* Information about a Device Defender security profile behavior violation. *
*/ public class ViolationEvent implements Serializable { /** ** The ID of the violation event. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*/
private String violationId;
/**
*
* The name of the thing responsible for the violation event. *
*
* Constraints:
* Length: 1 - 128
*/
private String thingName;
/**
*
* The name of the security profile whose behavior was violated. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*/
private String securityProfileName;
/**
*
* The behavior that was violated. *
*/ private Behavior behavior; /** ** The value of the metric (the measurement). *
*/ private MetricValue metricValue; /** ** The details of a violation event. *
*/ private ViolationEventAdditionalInfo violationEventAdditionalInfo; /** ** The type of violation event. *
*
* Constraints:
* Allowed Values: in-alarm, alarm-cleared, alarm-invalidated
*/
private String violationEventType;
/**
*
* The verification state of the violation (detect alarm). *
*
* Constraints:
* Allowed Values: FALSE_POSITIVE, BENIGN_POSITIVE, TRUE_POSITIVE,
* UNKNOWN
*/
private String verificationState;
/**
*
* The description of the verification state of the violation. *
*
* Constraints:
* Length: - 1000
* Pattern: [^\p{Cntrl}]*
*/
private String verificationStateDescription;
/**
*
* The time the violation event occurred. *
*/ private java.util.Date violationEventTime; /** ** The ID of the violation event. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*
* @return
* The ID of the violation event. *
*/ public String getViolationId() { return violationId; } /** ** The ID of the violation event. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*
* @param violationId
* The ID of the violation event. *
*/ public void setViolationId(String violationId) { this.violationId = violationId; } /** ** The ID of the violation event. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*
* @param violationId
* The ID of the violation event. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withViolationId(String violationId) { this.violationId = violationId; return this; } /** ** The name of the thing responsible for the violation event. *
*
* Constraints:
* Length: 1 - 128
*
* @return
* The name of the thing responsible for the violation event. *
*/ public String getThingName() { return thingName; } /** ** The name of the thing responsible for the violation event. *
*
* Constraints:
* Length: 1 - 128
*
* @param thingName
* The name of the thing responsible for the violation event. *
*/ public void setThingName(String thingName) { this.thingName = thingName; } /** ** The name of the thing responsible for the violation event. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
*
* @param thingName
* The name of the thing responsible for the violation event. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withThingName(String thingName) { this.thingName = thingName; return this; } /** ** The name of the security profile whose behavior was violated. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @return
* The name of the security profile whose behavior was violated. *
*/ public String getSecurityProfileName() { return securityProfileName; } /** ** The name of the security profile whose behavior was violated. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @param securityProfileName
* The name of the security profile whose behavior was violated. *
*/ public void setSecurityProfileName(String securityProfileName) { this.securityProfileName = securityProfileName; } /** ** The name of the security profile whose behavior was violated. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @param securityProfileName
* The name of the security profile whose behavior was violated. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withSecurityProfileName(String securityProfileName) { this.securityProfileName = securityProfileName; return this; } /** ** The behavior that was violated. *
* * @return* The behavior that was violated. *
*/ public Behavior getBehavior() { return behavior; } /** ** The behavior that was violated. *
* * @param behavior* The behavior that was violated. *
*/ public void setBehavior(Behavior behavior) { this.behavior = behavior; } /** ** The behavior that was violated. *
** Returns a reference to this object so that method calls can be chained * together. * * @param behavior
* The behavior that was violated. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withBehavior(Behavior behavior) { this.behavior = behavior; return this; } /** ** The value of the metric (the measurement). *
* * @return* The value of the metric (the measurement). *
*/ public MetricValue getMetricValue() { return metricValue; } /** ** The value of the metric (the measurement). *
* * @param metricValue* The value of the metric (the measurement). *
*/ public void setMetricValue(MetricValue metricValue) { this.metricValue = metricValue; } /** ** The value of the metric (the measurement). *
** Returns a reference to this object so that method calls can be chained * together. * * @param metricValue
* The value of the metric (the measurement). *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withMetricValue(MetricValue metricValue) { this.metricValue = metricValue; return this; } /** ** The details of a violation event. *
* * @return* The details of a violation event. *
*/ public ViolationEventAdditionalInfo getViolationEventAdditionalInfo() { return violationEventAdditionalInfo; } /** ** The details of a violation event. *
* * @param violationEventAdditionalInfo* The details of a violation event. *
*/ public void setViolationEventAdditionalInfo( ViolationEventAdditionalInfo violationEventAdditionalInfo) { this.violationEventAdditionalInfo = violationEventAdditionalInfo; } /** ** The details of a violation event. *
** Returns a reference to this object so that method calls can be chained * together. * * @param violationEventAdditionalInfo
* The details of a violation event. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withViolationEventAdditionalInfo( ViolationEventAdditionalInfo violationEventAdditionalInfo) { this.violationEventAdditionalInfo = violationEventAdditionalInfo; return this; } /** ** The type of violation event. *
*
* Constraints:
* Allowed Values: in-alarm, alarm-cleared, alarm-invalidated
*
* @return
* The type of violation event. *
* @see ViolationEventType */ public String getViolationEventType() { return violationEventType; } /** ** The type of violation event. *
*
* Constraints:
* Allowed Values: in-alarm, alarm-cleared, alarm-invalidated
*
* @param violationEventType
* The type of violation event. *
* @see ViolationEventType */ public void setViolationEventType(String violationEventType) { this.violationEventType = violationEventType; } /** ** The type of violation event. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: in-alarm, alarm-cleared, alarm-invalidated
*
* @param violationEventType
* The type of violation event. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ViolationEventType */ public ViolationEvent withViolationEventType(String violationEventType) { this.violationEventType = violationEventType; return this; } /** ** The type of violation event. *
*
* Constraints:
* Allowed Values: in-alarm, alarm-cleared, alarm-invalidated
*
* @param violationEventType
* The type of violation event. *
* @see ViolationEventType */ public void setViolationEventType(ViolationEventType violationEventType) { this.violationEventType = violationEventType.toString(); } /** ** The type of violation event. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: in-alarm, alarm-cleared, alarm-invalidated
*
* @param violationEventType
* The type of violation event. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ViolationEventType */ public ViolationEvent withViolationEventType(ViolationEventType violationEventType) { this.violationEventType = violationEventType.toString(); return this; } /** ** The verification state of the violation (detect alarm). *
*
* Constraints:
* Allowed Values: FALSE_POSITIVE, BENIGN_POSITIVE, TRUE_POSITIVE,
* UNKNOWN
*
* @return
* The verification state of the violation (detect alarm). *
* @see VerificationState */ public String getVerificationState() { return verificationState; } /** ** The verification state of the violation (detect alarm). *
*
* Constraints:
* Allowed Values: FALSE_POSITIVE, BENIGN_POSITIVE, TRUE_POSITIVE,
* UNKNOWN
*
* @param verificationState
* The verification state of the violation (detect alarm). *
* @see VerificationState */ public void setVerificationState(String verificationState) { this.verificationState = verificationState; } /** ** The verification state of the violation (detect alarm). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: FALSE_POSITIVE, BENIGN_POSITIVE, TRUE_POSITIVE,
* UNKNOWN
*
* @param verificationState
* The verification state of the violation (detect alarm). *
* @return A reference to this updated object so that method calls can be * chained together. * @see VerificationState */ public ViolationEvent withVerificationState(String verificationState) { this.verificationState = verificationState; return this; } /** ** The verification state of the violation (detect alarm). *
*
* Constraints:
* Allowed Values: FALSE_POSITIVE, BENIGN_POSITIVE, TRUE_POSITIVE,
* UNKNOWN
*
* @param verificationState
* The verification state of the violation (detect alarm). *
* @see VerificationState */ public void setVerificationState(VerificationState verificationState) { this.verificationState = verificationState.toString(); } /** ** The verification state of the violation (detect alarm). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: FALSE_POSITIVE, BENIGN_POSITIVE, TRUE_POSITIVE,
* UNKNOWN
*
* @param verificationState
* The verification state of the violation (detect alarm). *
* @return A reference to this updated object so that method calls can be * chained together. * @see VerificationState */ public ViolationEvent withVerificationState(VerificationState verificationState) { this.verificationState = verificationState.toString(); return this; } /** ** The description of the verification state of the violation. *
*
* Constraints:
* Length: - 1000
* Pattern: [^\p{Cntrl}]*
*
* @return
* The description of the verification state of the violation. *
*/ public String getVerificationStateDescription() { return verificationStateDescription; } /** ** The description of the verification state of the violation. *
*
* Constraints:
* Length: - 1000
* Pattern: [^\p{Cntrl}]*
*
* @param verificationStateDescription
* The description of the verification state of the violation. *
*/ public void setVerificationStateDescription(String verificationStateDescription) { this.verificationStateDescription = verificationStateDescription; } /** ** The description of the verification state of the violation. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 1000
* Pattern: [^\p{Cntrl}]*
*
* @param verificationStateDescription
* The description of the verification state of the violation. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withVerificationStateDescription(String verificationStateDescription) { this.verificationStateDescription = verificationStateDescription; return this; } /** ** The time the violation event occurred. *
* * @return* The time the violation event occurred. *
*/ public java.util.Date getViolationEventTime() { return violationEventTime; } /** ** The time the violation event occurred. *
* * @param violationEventTime* The time the violation event occurred. *
*/ public void setViolationEventTime(java.util.Date violationEventTime) { this.violationEventTime = violationEventTime; } /** ** The time the violation event occurred. *
** Returns a reference to this object so that method calls can be chained * together. * * @param violationEventTime
* The time the violation event occurred. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ViolationEvent withViolationEventTime(java.util.Date violationEventTime) { this.violationEventTime = violationEventTime; 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 (getViolationId() != null) sb.append("violationId: " + getViolationId() + ","); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); if (getSecurityProfileName() != null) sb.append("securityProfileName: " + getSecurityProfileName() + ","); if (getBehavior() != null) sb.append("behavior: " + getBehavior() + ","); if (getMetricValue() != null) sb.append("metricValue: " + getMetricValue() + ","); if (getViolationEventAdditionalInfo() != null) sb.append("violationEventAdditionalInfo: " + getViolationEventAdditionalInfo() + ","); if (getViolationEventType() != null) sb.append("violationEventType: " + getViolationEventType() + ","); if (getVerificationState() != null) sb.append("verificationState: " + getVerificationState() + ","); if (getVerificationStateDescription() != null) sb.append("verificationStateDescription: " + getVerificationStateDescription() + ","); if (getViolationEventTime() != null) sb.append("violationEventTime: " + getViolationEventTime()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getViolationId() == null) ? 0 : getViolationId().hashCode()); hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getSecurityProfileName() == null) ? 0 : getSecurityProfileName().hashCode()); hashCode = prime * hashCode + ((getBehavior() == null) ? 0 : getBehavior().hashCode()); hashCode = prime * hashCode + ((getMetricValue() == null) ? 0 : getMetricValue().hashCode()); hashCode = prime * hashCode + ((getViolationEventAdditionalInfo() == null) ? 0 : getViolationEventAdditionalInfo().hashCode()); hashCode = prime * hashCode + ((getViolationEventType() == null) ? 0 : getViolationEventType().hashCode()); hashCode = prime * hashCode + ((getVerificationState() == null) ? 0 : getVerificationState().hashCode()); hashCode = prime * hashCode + ((getVerificationStateDescription() == null) ? 0 : getVerificationStateDescription().hashCode()); hashCode = prime * hashCode + ((getViolationEventTime() == null) ? 0 : getViolationEventTime().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ViolationEvent == false) return false; ViolationEvent other = (ViolationEvent) obj; if (other.getViolationId() == null ^ this.getViolationId() == null) return false; if (other.getViolationId() != null && other.getViolationId().equals(this.getViolationId()) == false) return false; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; if (other.getSecurityProfileName() == null ^ this.getSecurityProfileName() == null) return false; if (other.getSecurityProfileName() != null && other.getSecurityProfileName().equals(this.getSecurityProfileName()) == false) return false; if (other.getBehavior() == null ^ this.getBehavior() == null) return false; if (other.getBehavior() != null && other.getBehavior().equals(this.getBehavior()) == false) return false; if (other.getMetricValue() == null ^ this.getMetricValue() == null) return false; if (other.getMetricValue() != null && other.getMetricValue().equals(this.getMetricValue()) == false) return false; if (other.getViolationEventAdditionalInfo() == null ^ this.getViolationEventAdditionalInfo() == null) return false; if (other.getViolationEventAdditionalInfo() != null && other.getViolationEventAdditionalInfo().equals( this.getViolationEventAdditionalInfo()) == false) return false; if (other.getViolationEventType() == null ^ this.getViolationEventType() == null) return false; if (other.getViolationEventType() != null && other.getViolationEventType().equals(this.getViolationEventType()) == false) return false; if (other.getVerificationState() == null ^ this.getVerificationState() == null) return false; if (other.getVerificationState() != null && other.getVerificationState().equals(this.getVerificationState()) == false) return false; if (other.getVerificationStateDescription() == null ^ this.getVerificationStateDescription() == null) return false; if (other.getVerificationStateDescription() != null && other.getVerificationStateDescription().equals( this.getVerificationStateDescription()) == false) return false; if (other.getViolationEventTime() == null ^ this.getViolationEventTime() == null) return false; if (other.getViolationEventTime() != null && other.getViolationEventTime().equals(this.getViolationEventTime()) == false) return false; return true; } }