Package formflow.library.data
Class Submission
java.lang.Object
formflow.library.data.Submission
A class representing what a submission of the form flow looks like in the database.
This class also provides a few static functions to work with Submissions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearAddressFields(String inputName) Removes the data in the inputData pertaining to the inputName of the address passed in.static SubmissioncopySubmission(Submission origSubmission) Create a deep copy of the given submission.booleangetSubflowEntryByUuid(String subflowName, String uuid) Provides access to a specific subflow's submission data for a particular UUID, if the subflow is present in the submission.inthashCode()voidmergeFormDataWithSubflowIterationData(String subflowName, Map<String, Object> iterationToUpdate, Map<String, Object> formDataSubmission) Merges the passed in subflow's iteration data into the Submission's subflow's data for that iteration.voidmergeFormDataWithSubmissionData(FormSubmission formSubmission) Merges the passed in data into the data stored in the Submission.voidmergeUrlParamsWithData(Map<String, String> queryParams) Merges the passed in query parameters into the Submission's urlParams MapvoidremoveIncompleteIterations(String subflowName, String currentUuid) Removes any data in an interation that has "iterationIsComplete" set to "false" and has auuidnot equal to thecurrentUuidprovided.
-
Constructor Details
-
Submission
public Submission()Creates a newSubmissionwith empty content
-
-
Method Details
-
getSubflowEntryByUuid
Provides access to a specific subflow's submission data for a particular UUID, if the subflow is present in the submission.If the subflow is present in the submission, this method will return the data matching the passed in UUID for that subflow.
If the subflow is not present in the submission or the UUID is not present in a set of the subflow's data, null will be returned. TODO this will actually throw an exception, it seems, if the subflow is found, but the UUID is not in it - maybe that's okay?
- Parameters:
subflowName- subflow of interest, not nulluuid- the uuid of the data of interest in the subflow, not null- Returns:
- the requested subflow's set of data for the uuid, null if subflow not present
-
mergeFormDataWithSubmissionData
Merges the passed in data into the data stored in the Submission.The Submission will be updated with the merged data.
- Parameters:
formSubmission- new data to be merged with data in the submission, may be empty but should not be null
-
mergeUrlParamsWithData
Merges the passed in query parameters into the Submission's urlParams Map- Parameters:
queryParams- the Map of query parameters to merge in
-
mergeFormDataWithSubflowIterationData
public void mergeFormDataWithSubflowIterationData(String subflowName, Map<String, Object> iterationToUpdate, Map<String, Object> formDataSubmission) Merges the passed in subflow's iteration data into the Submission's subflow's data for that iteration.- Parameters:
subflowName- subflow that the iteration data belongs with, not nulliterationToUpdate- existing data for a particular iteration of a subflow, may be empty, but not nullformDataSubmission- new data for a particular iteration of a subflow, not null
-
removeIncompleteIterations
Removes any data in an interation that has "iterationIsComplete" set to "false" and has auuidnot equal to thecurrentUuidprovided.- Parameters:
subflowName- subflow that we are checking the iteration data for, not nullcurrentUuid- The current uuid being worked on, not null. The data associated with this uuid will not be deleted.
-
clearAddressFields
Removes the data in the inputData pertaining to the inputName of the address passed in.- Parameters:
inputName- name of the address field to clear the data of
-
copySubmission
Create a deep copy of the given submission.- Parameters:
origSubmission- given submission to copy- Returns:
- deep copy of origSubmission
-
equals
-
hashCode
public int hashCode()
-