/* * Copyright 2018-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.iotfleetwise.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Information about a collection scheme that uses a simple logical expression to recognize what data to collect. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ConditionBasedCollectionScheme implements Serializable, Cloneable, StructuredPojo { /** *
* The logical expression used to recognize what data to collect. For example,
* $variable.Vehicle.OutsideAirTemperature >= 105.0
.
*
* The minimum duration of time between two triggering events to collect data, in milliseconds. *
** If a signal changes often, you might want to collect data at a slower rate. *
*
* Whether to collect data for all triggering events (ALWAYS
). Specify (RISING_EDGE
), or
* specify only when the condition first evaluates to false. For example, triggering on "AirbagDeployed"; Users
* aren't interested on triggering when the airbag is already exploded; they only care about the change from not
* deployed => deployed.
*
* Specifies the version of the conditional expression language. *
*/ private Integer conditionLanguageVersion; /** *
* The logical expression used to recognize what data to collect. For example,
* $variable.Vehicle.OutsideAirTemperature >= 105.0
.
*
$variable.Vehicle.OutsideAirTemperature >= 105.0
.
*/
public void setExpression(String expression) {
this.expression = expression;
}
/**
*
* The logical expression used to recognize what data to collect. For example,
* $variable.Vehicle.OutsideAirTemperature >= 105.0
.
*
$variable.Vehicle.OutsideAirTemperature >= 105.0
.
*/
public String getExpression() {
return this.expression;
}
/**
*
* The logical expression used to recognize what data to collect. For example,
* $variable.Vehicle.OutsideAirTemperature >= 105.0
.
*
$variable.Vehicle.OutsideAirTemperature >= 105.0
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConditionBasedCollectionScheme withExpression(String expression) {
setExpression(expression);
return this;
}
/**
* * The minimum duration of time between two triggering events to collect data, in milliseconds. *
** If a signal changes often, you might want to collect data at a slower rate. *
** If a signal changes often, you might want to collect data at a slower rate. *
*/ public void setMinimumTriggerIntervalMs(Long minimumTriggerIntervalMs) { this.minimumTriggerIntervalMs = minimumTriggerIntervalMs; } /** ** The minimum duration of time between two triggering events to collect data, in milliseconds. *
** If a signal changes often, you might want to collect data at a slower rate. *
** If a signal changes often, you might want to collect data at a slower rate. *
*/ public Long getMinimumTriggerIntervalMs() { return this.minimumTriggerIntervalMs; } /** ** The minimum duration of time between two triggering events to collect data, in milliseconds. *
** If a signal changes often, you might want to collect data at a slower rate. *
** If a signal changes often, you might want to collect data at a slower rate. *
* @return Returns a reference to this object so that method calls can be chained together. */ public ConditionBasedCollectionScheme withMinimumTriggerIntervalMs(Long minimumTriggerIntervalMs) { setMinimumTriggerIntervalMs(minimumTriggerIntervalMs); return this; } /** *
* Whether to collect data for all triggering events (ALWAYS
). Specify (RISING_EDGE
), or
* specify only when the condition first evaluates to false. For example, triggering on "AirbagDeployed"; Users
* aren't interested on triggering when the airbag is already exploded; they only care about the change from not
* deployed => deployed.
*
ALWAYS
). Specify (RISING_EDGE
* ), or specify only when the condition first evaluates to false. For example, triggering on
* "AirbagDeployed"; Users aren't interested on triggering when the airbag is already exploded; they only
* care about the change from not deployed => deployed.
* @see TriggerMode
*/
public void setTriggerMode(String triggerMode) {
this.triggerMode = triggerMode;
}
/**
*
* Whether to collect data for all triggering events (ALWAYS
). Specify (RISING_EDGE
), or
* specify only when the condition first evaluates to false. For example, triggering on "AirbagDeployed"; Users
* aren't interested on triggering when the airbag is already exploded; they only care about the change from not
* deployed => deployed.
*
ALWAYS
). Specify (
* RISING_EDGE
), or specify only when the condition first evaluates to false. For example,
* triggering on "AirbagDeployed"; Users aren't interested on triggering when the airbag is already
* exploded; they only care about the change from not deployed => deployed.
* @see TriggerMode
*/
public String getTriggerMode() {
return this.triggerMode;
}
/**
*
* Whether to collect data for all triggering events (ALWAYS
). Specify (RISING_EDGE
), or
* specify only when the condition first evaluates to false. For example, triggering on "AirbagDeployed"; Users
* aren't interested on triggering when the airbag is already exploded; they only care about the change from not
* deployed => deployed.
*
ALWAYS
). Specify (RISING_EDGE
* ), or specify only when the condition first evaluates to false. For example, triggering on
* "AirbagDeployed"; Users aren't interested on triggering when the airbag is already exploded; they only
* care about the change from not deployed => deployed.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TriggerMode
*/
public ConditionBasedCollectionScheme withTriggerMode(String triggerMode) {
setTriggerMode(triggerMode);
return this;
}
/**
*
* Whether to collect data for all triggering events (ALWAYS
). Specify (RISING_EDGE
), or
* specify only when the condition first evaluates to false. For example, triggering on "AirbagDeployed"; Users
* aren't interested on triggering when the airbag is already exploded; they only care about the change from not
* deployed => deployed.
*
ALWAYS
). Specify (RISING_EDGE
* ), or specify only when the condition first evaluates to false. For example, triggering on
* "AirbagDeployed"; Users aren't interested on triggering when the airbag is already exploded; they only
* care about the change from not deployed => deployed.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TriggerMode
*/
public ConditionBasedCollectionScheme withTriggerMode(TriggerMode triggerMode) {
this.triggerMode = triggerMode.toString();
return this;
}
/**
* * Specifies the version of the conditional expression language. *
* * @param conditionLanguageVersion * Specifies the version of the conditional expression language. */ public void setConditionLanguageVersion(Integer conditionLanguageVersion) { this.conditionLanguageVersion = conditionLanguageVersion; } /** ** Specifies the version of the conditional expression language. *
* * @return Specifies the version of the conditional expression language. */ public Integer getConditionLanguageVersion() { return this.conditionLanguageVersion; } /** ** Specifies the version of the conditional expression language. *
* * @param conditionLanguageVersion * Specifies the version of the conditional expression language. * @return Returns a reference to this object so that method calls can be chained together. */ public ConditionBasedCollectionScheme withConditionLanguageVersion(Integer conditionLanguageVersion) { setConditionLanguageVersion(conditionLanguageVersion); 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 (getExpression() != null) sb.append("Expression: ").append(getExpression()).append(","); if (getMinimumTriggerIntervalMs() != null) sb.append("MinimumTriggerIntervalMs: ").append(getMinimumTriggerIntervalMs()).append(","); if (getTriggerMode() != null) sb.append("TriggerMode: ").append(getTriggerMode()).append(","); if (getConditionLanguageVersion() != null) sb.append("ConditionLanguageVersion: ").append(getConditionLanguageVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ConditionBasedCollectionScheme == false) return false; ConditionBasedCollectionScheme other = (ConditionBasedCollectionScheme) obj; if (other.getExpression() == null ^ this.getExpression() == null) return false; if (other.getExpression() != null && other.getExpression().equals(this.getExpression()) == false) return false; if (other.getMinimumTriggerIntervalMs() == null ^ this.getMinimumTriggerIntervalMs() == null) return false; if (other.getMinimumTriggerIntervalMs() != null && other.getMinimumTriggerIntervalMs().equals(this.getMinimumTriggerIntervalMs()) == false) return false; if (other.getTriggerMode() == null ^ this.getTriggerMode() == null) return false; if (other.getTriggerMode() != null && other.getTriggerMode().equals(this.getTriggerMode()) == false) return false; if (other.getConditionLanguageVersion() == null ^ this.getConditionLanguageVersion() == null) return false; if (other.getConditionLanguageVersion() != null && other.getConditionLanguageVersion().equals(this.getConditionLanguageVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getExpression() == null) ? 0 : getExpression().hashCode()); hashCode = prime * hashCode + ((getMinimumTriggerIntervalMs() == null) ? 0 : getMinimumTriggerIntervalMs().hashCode()); hashCode = prime * hashCode + ((getTriggerMode() == null) ? 0 : getTriggerMode().hashCode()); hashCode = prime * hashCode + ((getConditionLanguageVersion() == null) ? 0 : getConditionLanguageVersion().hashCode()); return hashCode; } @Override public ConditionBasedCollectionScheme clone() { try { return (ConditionBasedCollectionScheme) 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.iotfleetwise.model.transform.ConditionBasedCollectionSchemeMarshaller.getInstance().marshall(this, protocolMarshaller); } }