OSDN Git Service

NeverNote 0.88.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / requests / EnSearchRequest.java
1 /*\r
2  * This file is part of NeverNote \r
3  * Copyright 2009 Randy Baumgarte\r
4  * \r
5  * This file may be licensed under the terms of of the\r
6  * GNU General Public License Version 2 (the ``GPL'').\r
7  *\r
8  * Software distributed under the License is distributed\r
9  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either\r
10  * express or implied. See the GPL for the specific language\r
11  * governing rights and limitations.\r
12  *\r
13  * You should have received a copy of the GPL along with this\r
14  * program. If not, go to http://www.gnu.org/licenses/gpl.html\r
15  * or write to the Free Software Foundation, Inc.,\r
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
17  *\r
18 */\r
19 \r
20 package cx.fbn.nevernote.sql.requests;\r
21 \r
22 import java.util.ArrayList;\r
23 import java.util.List;\r
24 \r
25 import com.evernote.edam.type.Note;\r
26 import com.evernote.edam.type.Tag;\r
27 \r
28 \r
29 public class EnSearchRequest extends DBRunnerRequest {\r
30         public volatile String                  string1;\r
31         public volatile List<Tag>               tags;\r
32         public volatile int                             int1;\r
33         public volatile int                             int2;\r
34         public volatile List<Note>              responseNotes;\r
35         public volatile List<String>    responseStrings;\r
36 \r
37         \r
38         public EnSearchRequest() {\r
39                 category = ENSEARCH;\r
40         }\r
41         \r
42         public EnSearchRequest copy() {\r
43                 EnSearchRequest request = new EnSearchRequest();\r
44                 \r
45                 request.requestor_id = requestor_id;\r
46                 request.type = type;\r
47                 request.int1 = int1;\r
48                 request.int2 = int2;\r
49                 request.category = category;\r
50                 if (string1 != null)\r
51                         request.string1 = new String(string1);\r
52                 if (tags!=null) { \r
53                         request.tags = new ArrayList<Tag>();\r
54                         for (int i=0; i<tags.size(); i++)\r
55                                 request.tags.add(tags.get(i).deepCopy());\r
56                 }\r
57                 \r
58                 if (responseNotes != null) {\r
59                         request.responseNotes = new ArrayList<Note>();\r
60                         for (int i=0; i<responseNotes.size(); i++) {\r
61                                 request.responseNotes.add(responseNotes.get(i).deepCopy());\r
62                         }\r
63                 }\r
64                 \r
65                 if (responseStrings != null) {\r
66                         request.responseStrings = new ArrayList<String>();\r
67                         for (int i=0; i<responseStrings.size(); i++) {\r
68                                 request.responseStrings.add(new String(responseStrings.get(i)));\r
69                         }\r
70                 }\r
71 \r
72                 return request;\r
73         }\r
74         \r
75 }