Changes Listed below:
[music.git] / src / main / java / org / onap / music / datastore / PreparedQueryObject.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
4  * ===================================================================
5  *  Copyright (c) 2017 AT&T Intellectual Property
6  * ===================================================================
7  *  Licensed under the Apache License, Version 2.0 (the "License");
8  *  you may not use this file except in compliance with the License.
9  *  You may obtain a copy of the License at
10  * 
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  *  Unless required by applicable law or agreed to in writing, software
14  *  distributed under the License is distributed on an "AS IS" BASIS,
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *  See the License for the specific language governing permissions and
17  *  limitations under the License.
18  * 
19  * ============LICENSE_END=============================================
20  * ====================================================================
21  */
22
23 package org.onap.music.datastore;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 /**
29  * 
30  * @author srupane
31  *
32  */
33 public class PreparedQueryObject {
34
35
36     private List<Object> values;
37     private StringBuilder query;
38     private String consistency;
39     private String keyspaceName;
40     private String tableName;
41     private String operation;
42     private String primaryKeyValue;
43
44
45
46     public String getKeyspaceName() {
47         return keyspaceName;
48     }
49
50     public void setKeyspaceName(String keyspaceName) {
51         this.keyspaceName = keyspaceName;
52     }
53
54     public String getTableName() {
55         return tableName;
56     }
57
58     public void setTableName(String tableName) {
59         this.tableName = tableName;
60     }
61
62     public String getOperation() {
63         return operation;
64     }
65
66     public void setOperation(String operation) {
67         this.operation = operation;
68     }
69
70     public String getPrimaryKeyValue() {
71         return primaryKeyValue;
72     }
73
74     public void setPrimaryKeyValue(String primaryKeyValue) {
75         this.primaryKeyValue = primaryKeyValue;
76     }
77
78     public String getConsistency() {
79         return consistency;
80     }
81
82     public void setConsistency(String consistency) {
83         this.consistency = consistency;
84     }
85
86         /**
87      * 
88      */
89     public PreparedQueryObject() {
90
91         this.values = new ArrayList<>();
92         this.query = new StringBuilder();
93     }
94
95     /**
96      * @return
97      */
98     public List<Object> getValues() {
99         return values;
100     }
101
102     /**
103      * @param o
104      */
105     public void addValue(Object o) {
106         this.values.add(o);
107     }
108
109     /**
110      * @param s
111      */
112     public void appendQueryString(String s) {
113         this.query.append(s);
114     }
115     public void replaceQueryString(String s) {
116         this.query.replace(0, query.length(), s);
117     }
118
119     /**
120      * @return
121      */
122     public String getQuery() {
123         return this.query.toString();
124     }
125 }