1 /*****************************************************************************
5 * Creation date 14.11.2012
8 * @copyright OPEN CASCADE 2012
9 *****************************************************************************/
11 package org.splat.service.dto;
13 import java.util.ArrayList;
14 import java.util.List;
17 * Document DTO. This is a container of document files.
19 public class DocumentDTO {
21 * Document persistent id.
27 private String _title;
29 * List of document files.
31 private final List<FileDTO> _files = new ArrayList<FileDTO>(); // RKV: NOPMD: Access to the collection via getter
34 * Constructor with initialization.
37 * the document persistent id
41 public DocumentDTO(final long index, final String title) {
51 public List<FileDTO> getFiles() {
70 public void setId(final Long id) {
79 public String getTitle() {
89 public void setTitle(final String title) {
101 * processing instruction: file-download or file-import
103 * true if the file is result
104 * @return the added file DTO
106 public FileDTO addFile(final String relativePath, final char state,
107 final String processing, final boolean isResult) {
108 FileDTO fileDTO = new FileDTO(relativePath, state, processing, isResult);
116 * @see java.lang.Object#toString()
119 public String toString() {
120 StringBuffer buf = new StringBuffer();
122 buf.append(indent).append("Document: ").append(getTitle()).append('\n')
123 .append(indent).append("Document ID: ").append(getId()).append(
125 for (FileDTO file : getFiles()) {
128 return buf.toString();