1 /*****************************************************************************
5 * Creation date 14.11.2012
8 * @copyright OPEN CASCADE 2012-2015
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) {
47 * Default constructor.
49 public DocumentDTO() {
50 // The empty constructor
58 public List<FileDTO> getFiles() {
77 public void setId(final Long id) {
86 public String getTitle() {
96 public void setTitle(final String title) {
101 * Add a new file DTO.
105 * @param relativePath
110 * processing instruction: file-download or file-import
112 * true if the file is result
113 * @return the added file DTO
115 public FileDTO addFile(final long id, final String relativePath, final char state,
116 final String processing, final boolean isResult) {
117 FileDTO fileDTO = new FileDTO(id, relativePath, state, processing, isResult);
123 * Add a new file DTO.
124 * @param file the file to be added.
126 public void addFile(final FileDTO file) {
133 * @see java.lang.Object#toString()
136 public String toString() {
137 StringBuffer buf = new StringBuffer();
139 buf.append(indent).append("Document: ").append(getTitle()).append('\n')
140 .append(indent).append("Document ID: ").append(getId()).append(
142 for (FileDTO file : getFiles()) {
145 return buf.toString();