2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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 * ============LICENSE_END=========================================================
22 package org.onap.champ.entity;
24 import com.google.gson.Gson;
25 import com.google.gson.GsonBuilder;
27 import java.util.ArrayList;
28 import java.util.List;
31 public class ChampBulkPayload {
33 public static String ADD_OP = "add";
34 public static String UPDATE_OP = "modify";
35 public static String DELETE_OP = "delete";
36 public static String PATCH_OP = "patch";
38 private List<ChampBulkOp> edgeDeleteOps = new ArrayList<ChampBulkOp>();
39 private List<ChampBulkOp> vertexDeleteOps = new ArrayList<ChampBulkOp>();
40 private List<ChampBulkOp> vertexAddModifyOps = new ArrayList<ChampBulkOp>();
41 private List<ChampBulkOp> edgeAddModifyOps = new ArrayList<ChampBulkOp>();
43 private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
45 public String toJson() {
46 return gson.toJson(this);
49 public static ChampBulkPayload fromJson(String payload) {
50 return gson.fromJson(payload, ChampBulkPayload.class);
53 public List<ChampBulkOp> getEdgeDeleteOps() {
57 public void setEdgeDeleteOps(List<ChampBulkOp> ops) {
58 this.edgeDeleteOps = ops;
61 public List<ChampBulkOp> getVertexDeleteOps() {
62 return vertexDeleteOps;
65 public void setVertexDeleteOps(List<ChampBulkOp> ops) {
66 this.vertexDeleteOps = ops;
69 public List<ChampBulkOp> getVertexAddModifyOps() {
70 return vertexAddModifyOps;
73 public void setVertexAddModifyOps(List<ChampBulkOp> ops) {
74 this.vertexAddModifyOps = ops;
77 public List<ChampBulkOp> getEdgeAddModifyOps() {
78 return edgeAddModifyOps;
81 public void setEdgeAddModifyOps(List<ChampBulkOp> ops) {
82 this.edgeAddModifyOps = ops;