public Builder(Form form, Sanitizer sanitizer) { this.formInstanceId = sanitizer.sanitize(form.formInstanceId); this.processInstanceId = sanitizer.sanitize(form.processInstanceId); this.submissionType = sanitizer.sanitize(form.submissionType); this.actionType = form.actionType; this.layout = sanitizer.sanitize(form.layout); this.applicationStatusExplanation = sanitizer.sanitize(form.applicationStatusExplanation); this.container = form.container != null ? new Container.Builder(form.container, sanitizer).build() : null; this.task = form.task != null ? new Task.Builder(form.task, sanitizer).build() : null; this.explanation = form.explanation; if (form.data != null && !form.data.isEmpty()) this.data = new ManyMap<String, Value>(form.data); else this.data = new ManyMap<String, Value>(); if (form.validation != null && !form.validation.isEmpty()) this.validation = new ManyMap<String, Message>(form.validation); else this.validation = new ManyMap<String, Message>(); this.attachments = form.getAttachments(); this.attachmentCount = form.getAttachments().size(); this.valid = form.valid; this.external = form.external; this.allowAttachments = form.allowAttachments; this.anonymous = form.anonymous; this.process = form.process; this.currentUser = form.currentUser; this.bucketList = form.bucketList != null ? new BucketList.Builder(form.bucketList, sanitizer).build() : null; }