Home
Cloud
Big Data
CI
Install
Samples
Java
Ubuntu
Maven
Archive
mtitek-process-core-runtime-api
|
ProcessRuntimePayload.java
ProcessRuntimePayload.java
ProcessRuntimePayload.java
package mtitek.process.runtime; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class ProcessRuntimePayload implements Serializable { private static final long serialVersionUID = -4592441641154135606L; private String payloadId; private Object payload; private final Map<String, String> parameters = new ConcurrentHashMap<>(); private final Map<String, Object> variables = new ConcurrentHashMap<>(); public ProcessRuntimePayload(final String payloadId, final Object payload, final Map<String, String> parameters) { this.payloadId = payloadId; this.payload = payload; if (parameters != null) { this.parameters.putAll(parameters); } } public String getPayloadId() { return payloadId; } public void setPayloadId(final String id) { this.payloadId = id; } public Object getPayload() { return payload; } public void setPayload(final Object payload) { this.payload = payload; } public Map<String, String> getParameters() { final Map<String, String> parameters = new HashMap<>(); parameters.putAll(this.parameters); return parameters; } public void setParameters(final Map<String, String> parameters) { this.parameters.clear(); if (parameters != null) { this.parameters.putAll(parameters); } } public void addParameters(final String parameterName, final String parameterValue) { this.parameters.put(parameterName, parameterValue); } public Map<String, Object> getVariables() { final Map<String, Object> variables = new HashMap<>(); variables.putAll(this.variables); return variables; } public void setVariables(final Map<String, Object> variables) { this.variables.clear(); if (variables != null) { this.variables.putAll(variables); } } public void addVariables(final String parameterName, final Object parameterValue) { this.variables.put(parameterName, parameterValue); } @Override public String toString() { return String.format("ProcessRuntimePayload: payloadId='%s', variables=[%s], parameters=[%s]", payloadId, variables, parameters); } }
© 2010-2022
mti
tek