faef9b8f0e0aea8bb5d2e095f65ee2599b5742a1
[music.git] / src / main / java / org / onap / music / datastore / jsonobjects / JsonSelect.java
1 /*
2  * ============LICENSE_START==========================================
3  * org.onap.music
4  * ===================================================================
5  *  Copyright (c) 2017 AT&T Intellectual Property
6  *  Modifications Copyright (C) 2018 IBM.
7  * ===================================================================
8  *  Licensed under the Apache License, Version 2.0 (the "License");
9  *  you may not use this file except in compliance with the License.
10  *  You may obtain a copy of the License at
11  * 
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  *  Unless required by applicable law or agreed to in writing, software
15  *  distributed under the License is distributed on an "AS IS" BASIS,
16  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  *  See the License for the specific language governing permissions and
18  *  limitations under the License.
19  * 
20  * ============LICENSE_END=============================================
21  * ====================================================================
22  */
23
24 package org.onap.music.datastore.jsonobjects;
25
26 import java.io.ByteArrayOutputStream;
27 import java.io.IOException;
28 import java.io.ObjectOutput;
29 import java.io.ObjectOutputStream;
30 import java.io.Serializable;
31 import java.util.Map;
32
33 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
34
35 @JsonIgnoreProperties(ignoreUnknown = true)
36 public class JsonSelect implements Serializable {
37     private Map<String, String> consistencyInfo;
38
39
40     public Map<String, String> getConsistencyInfo() {
41         return consistencyInfo;
42     }
43
44     public void setConsistencyInfo(Map<String, String> consistencyInfo) {
45         this.consistencyInfo = consistencyInfo;
46     }
47
48     public byte[] serialize() {
49         ByteArrayOutputStream bos = new ByteArrayOutputStream();
50         ObjectOutput out = null;
51         try {
52             out = new ObjectOutputStream(bos);
53             out.writeObject(this);
54         } catch (IOException e) {
55             // TODO Auto-generated catch block
56             e.printStackTrace();
57         }
58         return bos.toByteArray();
59     }
60
61 }