Package step.functions.io
Class OutputBuilder
java.lang.Object
step.functions.io.OutputBuilder
A builder for Output instances.
-
Constructor Summary
Constructors -
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.voidaddAttachment(Attachment attachment) Adds an attachment to the outputvoidaddAttachments(List<Attachment> attachments) Adds attachments to the outputvoidaddMeasure(String measureName, long durationMillis) Adds a performance measurementvoidaddMeasure(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.JsonObjectBuildersetBusinessError(String businessError) Reports a business error.Reports a technical error.Reports a technical error and appends the exception causing this error as attachmentvoidvoidsetPayloadBuilder(javax.json.JsonObjectBuilder payloadBuilder) voidsetPayloadJson(String payloadJson) voidstartMeasure(String id) Starts a performance measurement.voidstartMeasure(String id, long begin) Starts a performance measurementvoidStops the current performance measurement and adds it to the outputvoidstopMeasure(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
-