2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Modifications Copyright (C) 2019 IBM.
9 * ================================================================================
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 * ============LICENSE_END=========================================================
24 package org.onap.champ.entity;
26 import com.google.gson.Gson;
27 import com.google.gson.GsonBuilder;
29 import java.util.ArrayList;
30 import java.util.List;
33 public class ChampBulkPayload {
35 public static final String ADD_OP = "add";
36 public static final String UPDATE_OP = "modify";
37 public static final String DELETE_OP = "delete";
38 public static final String PATCH_OP = "patch";
40 private List<ChampBulkOp> edgeDeleteOps = new ArrayList<ChampBulkOp>();
41 private List<ChampBulkOp> vertexDeleteOps = new ArrayList<ChampBulkOp>();
42 private List<ChampBulkOp> vertexAddModifyOps = new ArrayList<ChampBulkOp>();
43 private List<ChampBulkOp> edgeAddModifyOps = new ArrayList<ChampBulkOp>();
45 private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create();
47 public String toJson() {
48 return gson.toJson(this);
51 public static ChampBulkPayload fromJson(String payload) {
52 return gson.fromJson(payload, ChampBulkPayload.class);
55 public List<ChampBulkOp> getEdgeDeleteOps() {
59 public void setEdgeDeleteOps(List<ChampBulkOp> ops) {
60 this.edgeDeleteOps = ops;
63 public List<ChampBulkOp> getVertexDeleteOps() {
64 return vertexDeleteOps;
67 public void setVertexDeleteOps(List<ChampBulkOp> ops) {
68 this.vertexDeleteOps = ops;
71 public List<ChampBulkOp> getVertexAddModifyOps() {
72 return vertexAddModifyOps;
75 public void setVertexAddModifyOps(List<ChampBulkOp> ops) {
76 this.vertexAddModifyOps = ops;
79 public List<ChampBulkOp> getEdgeAddModifyOps() {
80 return edgeAddModifyOps;
83 public void setEdgeAddModifyOps(List<ChampBulkOp> ops) {
84 this.edgeAddModifyOps = ops;