Salome HOME
ScenarioService.getScenarioInfo method is added.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / dto / DocumentDTO.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   14.11.2012
6  * @author         $Author$
7  * @version        $Revision$
8  * @copyright      OPEN CASCADE 2012
9  *****************************************************************************/
10
11 package org.splat.service.dto;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 /**
17  * Document DTO. This is a container of document files.
18  */
19 public class DocumentDTO {
20         /**
21          * Document persistent id.
22          */
23         private Long _id;
24         /**
25          * Document title.
26          */
27         private String _title;
28         /**
29          * List of document files.
30          */
31         private final List<FileDTO> _files = new ArrayList<FileDTO>(); // RKV: NOPMD: Access to the collection via getter
32
33         /**
34          * Constructor with initialization.
35          * 
36          * @param index
37          *            the document persistent id
38          * @param title
39          *            the document title
40          */
41         public DocumentDTO(final long index, final String title) {
42                 _id = index;
43                 _title = title;
44         }
45
46         /**
47          * Get the files.
48          * 
49          * @return the files
50          */
51         public List<FileDTO> getFiles() {
52                 return _files;
53         }
54
55         /**
56          * Get the id.
57          * 
58          * @return the id
59          */
60         public Long getId() {
61                 return _id;
62         }
63
64         /**
65          * Set the id.
66          * 
67          * @param id
68          *            the id to set
69          */
70         public void setId(final Long id) {
71                 _id = id;
72         }
73
74         /**
75          * Get the title.
76          * 
77          * @return the title
78          */
79         public String getTitle() {
80                 return _title;
81         }
82
83         /**
84          * Set the title.
85          * 
86          * @param title
87          *            the title to set
88          */
89         public void setTitle(final String title) {
90                 _title = title;
91         }
92
93         /**
94          * Add a new file DTO.
95          * 
96          * @param relativePath
97          *            relative file path
98          * @param state
99          *            file state
100          * @return the added file DTO
101          */
102         public FileDTO addFile(final String relativePath, final char state) {
103                 FileDTO fileDTO = new FileDTO(relativePath, state);
104                 _files.add(fileDTO);
105                 return fileDTO;
106         }
107 }