aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-REST/src/main/java/org/openecomp/policy/rest/util/ModelObject.java
blob: bc7fa9f2d243d4e99206d82f9e068a00da49ad2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*-
 * ============LICENSE_START=======================================================
 * ECOMP-REST
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 

package org.openecomp.policy.rest.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;

public class ModelObject {
	private String name;
	private String parent;
	private List<String> attibutes = new ArrayList<String>();
	private List<String> arrays = new ArrayList<String>();
	private List<Integer> integers = new ArrayList<Integer>();
	private List<ModelObject> subObjects = new ArrayList<ModelObject>();
	private HashMap<String, LinkedList<ModelObject>> subObjectList = new HashMap<String, LinkedList<ModelObject>>();
	private HashMap<String, TextField> attribute = new HashMap<String, TextField>();
	private Map<String, LinkedList<TextField>> arrayTextList =  new HashMap<String, LinkedList<TextField>>();
	private Map<String,  VerticalLayout> textFieldLayout = new HashMap<String, VerticalLayout>();

	private boolean many = false;
	
	public Map<String, LinkedList<TextField>> getArrayTextList() {
		return arrayTextList;
	}
	public void setArrayTextList(Map<String, LinkedList<TextField>> arrayTextList) {
		this.arrayTextList = arrayTextList;
	}
	public void addArrayTextList(String name, TextField textField ){
		LinkedList<TextField> list = new LinkedList<TextField>();
		if (getArrayTextList().get(name) != null){
			list = getArrayTextList().get(name); 
		}

		list.push(textField);
		this.arrayTextList.put(name, list);
	}
	public void removeLastTextList(String name){
		LinkedList<TextField> list = getArrayTextList().get(name); 
		
		list.pop();
		this.arrayTextList.put(name, list);
	}
	public HashMap<String, TextField> getAttribute() {
		return attribute;
	}
	public void setAttribute(HashMap<String, TextField> attribute) {
		this.attribute = attribute;
	}
    public void addAttribute(String name, TextField textField){
    	this.attribute.put(name, textField);
    }
	public List<String> getAttibutes() {
		return attibutes;
	}
	public void setAttibutes(List<String> attibutes) {
		this.attibutes = attibutes;
	}
	public List<String> getArrays() {
		return arrays;
	}
	public void setArrays(List<String> arrays) {
		this.arrays = arrays;
	}
	public List<Integer> getIntegers() {
		return integers;
	}
	public void setIntegers(List<Integer> integers) {
		this.integers = integers;
	}
	public List<ModelObject> getSubObjects() {
		return subObjects;
	}
	public void setSubObjects(List<ModelObject> subObjects) {
		this.subObjects = subObjects;
	}
	public void addSubObject(ModelObject subObjects ){
		this.subObjects.add(subObjects);
	}
	public void addAttributes(String attibutes){
		this.attibutes.add(attibutes);
	}
	public void addArrays(String arrays){
		this.arrays.add(arrays);
	}
	public void addIntegers(Integer integers){
		this.integers.add(integers);
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isMany() {
		return many;
	}
	public void setMany(boolean many) {
		this.many = many;
	}
	public String getParent() {
		return parent;
	}
	public void setParent(String parent) {
		this.parent = parent;
	}
	public HashMap<String, LinkedList<ModelObject>> getSubObjectList() {
		return subObjectList;
	}
	public void setSubObjectList(HashMap<String, LinkedList<ModelObject>> subObjectList) {
		this.subObjectList = subObjectList;
	}
	public void addSubObjectList(String name, ModelObject object) {
		LinkedList<ModelObject> list = new LinkedList<ModelObject>();
		if (subObjectList.get(name) != null){
			list = subObjectList.get(name); 
		}

		list.push(object);

		this.subObjectList.put(name, list);
	}
	public Map<String,  VerticalLayout> getTextFieldLayout() {
		return textFieldLayout;
	}
	public void setTextFieldLayout(Map<String,  VerticalLayout> textFieldLayout) {
		this.textFieldLayout = textFieldLayout;
	}
	public void addTextFieldLayout(String name, VerticalLayout vLayout){
		this.textFieldLayout.put(name, vLayout);
	}

}
*/