software.amazon.awscdk.services.iotevents.alpha.State Maven / Gradle / Ivy
Show all versions of iotevents-alpha Show documentation
package software.amazon.awscdk.services.iotevents.alpha;
/**
* (experimental) Defines a state of a detector.
*
* Example:
*
*
* // Example automatically generated from non-compiling source. May contain errors.
* import software.amazon.awscdk.services.iotevents.alpha.*;
* import software.amazon.awscdk.services.iotevents.actions.alpha.*;
* IInput input;
* State state = State.Builder.create()
* .stateName("MyState")
* .onEnter(List.of(Event.builder()
* .eventName("test-event")
* .condition(Expression.currentInput(input))
* .actions(List.of(
* new SetTimerAction("MyTimer", Map.of(
* "duration", cdk.Duration.seconds(60)))))
* .build()))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-05T03:43:53.369Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.iotevents.alpha.$Module.class, fqn = "@aws-cdk/aws-iotevents-alpha.State")
public class State extends software.amazon.jsii.JsiiObject {
protected State(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected State(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public State(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iotevents.alpha.StateProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) Add a transition event to the state.
*
* The transition event will be triggered if condition is evaluated to true
.
*
* @param targetState the state that will be transit to when the event triggered. This parameter is required.
* @param options transition options including the condition that causes the state transition. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void transitionTo(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iotevents.alpha.State targetState, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iotevents.alpha.TransitionOptions options) {
software.amazon.jsii.Kernel.call(this, "transitionTo", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(targetState, "targetState is required"), java.util.Objects.requireNonNull(options, "options is required") });
}
/**
* (experimental) The name of the state.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getStateName() {
return software.amazon.jsii.Kernel.get(this, "stateName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.iotevents.alpha.State}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create() {
return new Builder();
}
private final software.amazon.awscdk.services.iotevents.alpha.StateProps.Builder props;
private Builder() {
this.props = new software.amazon.awscdk.services.iotevents.alpha.StateProps.Builder();
}
/**
* (experimental) The name of the state.
*
* @return {@code this}
* @param stateName The name of the state. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder stateName(final java.lang.String stateName) {
this.props.stateName(stateName);
return this;
}
/**
* (experimental) Specifies the events on enter.
*
* The conditions of the events will be evaluated when entering this state.
* If the condition of the event evaluates to true
, the actions of the event will be executed.
*
* Default: - no events will trigger on entering this state
*
* @return {@code this}
* @param onEnter Specifies the events on enter. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder onEnter(final java.util.List extends software.amazon.awscdk.services.iotevents.alpha.Event> onEnter) {
this.props.onEnter(onEnter);
return this;
}
/**
* (experimental) Specifies the events on exit.
*
* The conditions of the events are evaluated when an exiting this state.
* If the condition evaluates to true
, the actions of the event will be executed.
*
* Default: - no events will trigger on exiting this state
*
* @return {@code this}
* @param onExit Specifies the events on exit. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder onExit(final java.util.List extends software.amazon.awscdk.services.iotevents.alpha.Event> onExit) {
this.props.onExit(onExit);
return this;
}
/**
* (experimental) Specifies the events on input.
*
* The conditions of the events will be evaluated when any input is received.
* If the condition of the event evaluates to true
, the actions of the event will be executed.
*
* Default: - no events will trigger on input in this state
*
* @return {@code this}
* @param onInput Specifies the events on input. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder onInput(final java.util.List extends software.amazon.awscdk.services.iotevents.alpha.Event> onInput) {
this.props.onInput(onInput);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.iotevents.alpha.State}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.iotevents.alpha.State build() {
return new software.amazon.awscdk.services.iotevents.alpha.State(
this.props.build()
);
}
}
}