re base code
[sdc.git] / catalog-dao / src / main / java / org / openecomp / sdc / be / dao / neo4j / BatchBuilder.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.dao.neo4j;
22
23 import org.openecomp.sdc.be.dao.graph.datatype.GraphElement;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28 public class BatchBuilder {
29         // private Map<String, List<Neo4jNode>> nodes;
30         // private List<Neo4jRelation> relations;
31         //
32         private List<GraphElement> elements;
33
34         // TODO add filter
35
36         protected BatchBuilder() {
37                 // nodes = new HashMap<String, List<Neo4jNode>>();
38                 // relations = new ArrayList<Neo4jRelation>();
39                 elements = new ArrayList<>();
40         }
41
42         public static BatchBuilder getBuilder() {
43                 return new BatchBuilder();
44         }
45
46         public BatchBuilder add(GraphElement element) {
47                 elements.add(element);
48                 return this;
49         }
50
51         public List<GraphElement> getElements() {
52                 return elements;
53         }
54
55         // public BatchBuilder add( Neo4jNode element ){
56         // String label = element.getLabel();
57         // List<Neo4jNode> list = nodes.get(label);
58         // if ( list == null ){
59         // list = new ArrayList<Neo4jNode>();
60         // }
61         // list.add(element);
62         // nodes.put(label, list);
63
64         // return this;
65         // }
66         // public BatchBuilder add( Neo4jRelation relation ){
67         // relations.add(relation);
68         // return this;
69         // }
70         //
71         // public Map<String, List<Neo4jNode>> getNodes() {
72         // return nodes;
73         // }
74         //
75         // public List<Neo4jRelation> getRelations() {
76         // return relations;
77         // }
78
79 }