Mappings
The Mappings interface is used to build up key/destination mappings used when optionally translating the full Dispatch payload to just the relevant data for any given Dispatcher
Use the multiple mapFrom methods to supply the required source "key" and "destination" key, as well as any optional "path" entries required to access keys in nested object.
Using the following payload DataObject as an example (shown as JSON)
{
"source" : "value",
"path": {
"to" : {
"source": "nested value"
}
}
}Simple usage for keys in the top level DataObject would look like so:
mapFrom("source", "destination")More complex versions requiring accessing keys that exist in nested objects would look like so:
mapFrom(JsonPath["path"]["to"]["source"], JsonPath["path"]["to"]["destination"])The mapFrom method returns a VariableOptions that allows for setting optional properties relevant to a mapping.
See also
Types
The CommandOptions allows for configuring optional properties relevant only when mapping commands for Remote Command Dispatchers.
The ConstantOptions allows for configuring optional properties relevant only when mapping constant values to the destination.
The VariableOptions allows for configuring optional properties relevant only when mapping values from the source payload.
Functions
Builds and returns the list of mapping TransformationOperations that have been configured.
Adds a mapping where the value to map is given by the constant name and will be mapped to a fixed destination of Dispatch.Keys.COMMAND_NAME.
Adds a mapping where the value to map is given by the constant value and will be mapped to the given destination located/stored at some configured level of nesting as defined by the JsonObjectPath.
Adds a mapping where the value to map is given by the constant value and will be mapped to the given destination
Adds a mapping where both the path and destination can be located/stored at some configured level of nesting as defined by the JsonObjectPath for each input.
Adds a mapping where the destination is to be in the top level of the mapped payload, but the source key is defined at some nested object/list as defined by path.
Adds a mapping where the key is to be found in the top level of the input payload, but the destination key is to be defined at some nested object/list as defined by destination.
Adds a mapping where the key and destination are in the top level of the payload.
Utility method to start creating JsonObjectPaths. This method is shorthand for JsonPath.root