2 * This file is part of NeverNote
\r
3 * Copyright 2009 Randy Baumgarte
\r
5 * This file may be licensed under the terms of of the
\r
6 * GNU General Public License Version 2 (the ``GPL'').
\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
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
20 package cx.fbn.nevernote.sql.requests;
\r
22 import java.util.ArrayList;
\r
23 import java.util.List;
\r
25 import com.evernote.edam.type.Tag;
\r
27 public class TagRequest extends DBRunnerRequest {
\r
28 public static int Create_Table = 1;
\r
29 public static int Drop_Table = 2;
\r
30 public static int Add_Tag = 3;
\r
31 public static int Delete_Tag = 4;
\r
32 public static int Get_All = 5;
\r
33 public static int Get_Tag = 6;
\r
34 public static int Update_Tag = 7;
\r
35 public static int Expunge_Tag = 8;
\r
36 public static int Update_Parent = 9;
\r
37 public static int Save_Tags = 10;
\r
38 public static int Update_Tag_Sequence = 11;
\r
39 public static int Update_Tag_Guid = 12;
\r
40 public static int Get_Dirty = 13;
\r
41 public static int Find_Tag_By_Name = 14;
\r
42 public static int Exists = 15;
\r
43 public static int Reset_Dirty_Flag = 16;
\r
44 public static int Sync_Tag = 17;
\r
46 public volatile String string1;
\r
47 public volatile String string2;
\r
48 public volatile boolean bool1;
\r
49 public volatile int int1;
\r
51 public volatile Tag tag;
\r
52 public volatile List<Tag> tags;
\r
54 public volatile List<Tag> responseTags;
\r
55 public volatile Tag responseTag;
\r
56 public volatile String responseString;
\r
57 public volatile boolean responseBool;
\r
59 public TagRequest() {
\r
63 public TagRequest copy() {
\r
64 TagRequest request = new TagRequest();
\r
66 request.requestor_id = requestor_id;
\r
67 request.type = type;
\r
68 request.category = category;
\r
69 request.int1 = int1;
\r
70 if (string1 != null)
\r
71 request.string1 = new String(string1);
\r
72 if (string2 != null)
\r
73 request.string2 = new String(string2);
\r
76 request.bool1 = bool1;
\r
77 if (tags != null && tags.size() > 0) {
\r
78 for (int i=0; i<tags.size(); i++)
\r
79 request.tags.add(tags.get(i));
\r
82 responseBool = request.responseBool;
\r
83 if (responseString != null) {
\r
84 request.responseString = new String(responseString);
\r
87 if (responseTag != null)
\r
88 request.responseTag = responseTag.deepCopy();
\r
90 if (responseTags != null) {
\r
91 request.responseTags = new ArrayList<Tag>();
\r
92 for (int i =0; i<responseTags.size(); i++)
\r
93 request.responseTags.add(responseTags.get(i).deepCopy());
\r