Package step.functions.io
Class OutputBuilder
java.lang.Object
step.functions.io.OutputBuilder
A builder for Output instances.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.void
addAttachment
(Attachment attachment) Adds an attachment to the outputvoid
addAttachments
(List<Attachment> attachments) Adds attachments to the outputvoid
addMeasure
(String measureName, long durationMillis) Adds a performance measurementvoid
addMeasure
(String measureName, long aDurationMillis, Map<String, Object> data) Adds a performance measurement with custom dataappendError
(String technicalError) Appends a technical error message.Output<javax.json.JsonObject>
build()
Builds the output instancejavax.json.JsonObjectBuilder
setBusinessError
(String businessError) Reports a business error.Reports a technical error.Reports a technical error and appends the exception causing this error as attachmentvoid
void
setPayloadBuilder
(javax.json.JsonObjectBuilder payloadBuilder) void
setPayloadJson
(String payloadJson) void
startMeasure
(String id) Starts a performance measurement.void
startMeasure
(String id, long begin) Starts a performance measurementvoid
Stops the current performance measurement and adds it to the outputvoid
stopMeasure
(Map<String, Object> data) Stops the current performance measurement and adds it to the output.void
-
Constructor Details
-
OutputBuilder
public OutputBuilder()
-
-
Method Details
-
getPayloadBuilder
public javax.json.JsonObjectBuilder getPayloadBuilder() -
setPayloadBuilder
public void setPayloadBuilder(javax.json.JsonObjectBuilder payloadBuilder) -
add
Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Parameters:
name
- the name of the output attributevalue
- the value of the output attribute- Returns:
- this instance
-
add
Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Parameters:
name
- the name of the output attributevalue
- the value of the output attribute- Returns:
- this instance
-
add
Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Parameters:
name
- the name of the output attributevalue
- the value of the output attribute- Returns:
- this instance
-
add
Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Parameters:
name
- the name of the output attributevalue
- the value of the output attribute- Returns:
- this instance
-
add
Adds an output attribute If the object contains a mapping for the specified name, this method replaces the old value with the specified value.- Parameters:
name
- the name of the output attributevalue
- the value of the output attribute- Returns:
- this instance
-
setError
Reports a technical error. This will be reported as ERROR in STEP- Parameters:
technicalError
- the error message of the technical error- Returns:
- this instance
-
appendError
Appends a technical error message. Calling this method for the first time will have the same effect as calling setError- Parameters:
technicalError
- the error message of the technical error- Returns:
- this instance
-
setError
Reports a technical error and appends the exception causing this error as attachment- Parameters:
errorMessage
- the error message of the technical errore
- the exception that caused the technical error- Returns:
- this instance
-
setBusinessError
Reports a business error. This will be reported as FAILED in STEP- Parameters:
businessError
- the error message of the business error- Returns:
- this instance
-
setError
-
getPayloadJson
- Returns:
- the payload of this output. This has no eff
-
setPayloadJson
- Parameters:
payloadJson
- the payload of this output.
-
addAttachments
Adds attachments to the output- Parameters:
attachments
- the list of attachments to be added to the output
-
addAttachment
Adds an attachment to the output- Parameters:
attachment
- the attachment to be added to the output
-
startMeasure
Starts a performance measurement. The current time will be used as starttime- Parameters:
id
- a unique identifier of the measurement
-
startMeasure
Starts a performance measurement- Parameters:
id
- a unique identifier of the measurementbegin
- the start time of the measurement
-
addMeasure
Adds a performance measurement- Parameters:
measureName
- a unique identifier of the measurementdurationMillis
- the duration of the measurement in ms
-
addMeasure
Adds a performance measurement with custom data- Parameters:
measureName
- a unique identifier of the measurementaDurationMillis
- the duration of the measurement in msdata
- the custom data of the measurement
-
stopMeasure
public void stopMeasure()Stops the current performance measurement and adds it to the output -
stopMeasure
Stops the current performance measurement and adds it to the output.- Parameters:
data
- custom data to be added to the measurement
-
stopMeasureForAdditionalData
public void stopMeasureForAdditionalData() -
setLastMeasureAdditionalData
-
build
Builds the output instance- Returns:
- the output message
-