public class DefaultInputEvent extends Object implements InputEvent
InputEvent.| Constructor and Description |
|---|
DefaultInputEvent() |
DefaultInputEvent(Event event) |
DefaultInputEvent(InputEvent inputEvent) |
| Modifier and Type | Method and Description |
|---|---|
InputEvent |
addVariable(String key,
Object value)
Add a variable.
|
InputEvent |
addVariable(String key,
Object value,
DataType dataType)
Add a variable.
|
InputEvent |
error(Error error)
Sets an error related to the produced event.
|
Optional<Error> |
getError()
When a mule component throws an error then an
Error object gets generated with all the data associated to the error. |
Message |
getMessage()
Returns the message payload for this event
|
Map<String,TypedValue<?>> |
getVariables()
Returns the variables in the event
|
InputEvent |
message(Message message)
|
InputEvent |
variables(Map<String,?> variables)
Set a map of variables.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createpublic DefaultInputEvent()
public DefaultInputEvent(Event event)
public DefaultInputEvent(InputEvent inputEvent)
public InputEvent message(Message message)
InputEventmessage in interface InputEventmessage - the message instance.public InputEvent variables(Map<String,?> variables)
InputEventvariables in interface InputEventvariables - variables to be set.public InputEvent addVariable(String key, Object value)
InputEventaddVariable in interface InputEventkey - the key of the variable to add.value - the value of the variable to add. null values are supported.public InputEvent addVariable(String key, Object value, DataType dataType)
InputEventaddVariable in interface InputEventkey - the key of the variable to add.value - the value of the variable to add. null values are supported.dataType - additional metadata about the value type.public InputEvent error(Error error)
InputEventerror in interface InputEventerror - the error associated with the produced eventpublic Map<String,TypedValue<?>> getVariables()
InputEventgetVariables in interface InputEventTypedValue containing the variable's names and values.public Message getMessage()
InputEventgetMessage in interface InputEventpublic Optional<Error> getError()
InputEventError object gets generated with all the data associated to the error.
This field will only contain a value within the error handler defined to handle errors. After the error handler is executed
the event error field will be cleared. If another flow is called from within the error handler the flow will still have
access to the error field.
To avoid losing the error field after the error handler the user can define a variable pointing to the error field.getError in interface InputEventCopyright © 2017 MuleSoft, Inc.. All rights reserved.