/*- * ============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 attibutes = new ArrayList(); private List arrays = new ArrayList(); private List integers = new ArrayList(); private List subObjects = new ArrayList(); private HashMap> subObjectList = new HashMap>(); private HashMap attribute = new HashMap(); private Map> arrayTextList = new HashMap>(); private Map textFieldLayout = new HashMap(); private boolean many = false; public Map> getArrayTextList() { return arrayTextList; } public void setArrayTextList(Map> arrayTextList) { this.arrayTextList = arrayTextList; } public void addArrayTextList(String name, TextField textField ){ LinkedList list = new LinkedList(); if (getArrayTextList().get(name) != null){ list = getArrayTextList().get(name); } list.push(textField); this.arrayTextList.put(name, list); } public void removeLastTextList(String name){ LinkedList list = getArrayTextList().get(name); list.pop(); this.arrayTextList.put(name, list); } public HashMap getAttribute() { return attribute; } public void setAttribute(HashMap attribute) { this.attribute = attribute; } public void addAttribute(String name, TextField textField){ this.attribute.put(name, textField); } public List getAttibutes() { return attibutes; } public void setAttibutes(List attibutes) { this.attibutes = attibutes; } public List getArrays() { return arrays; } public void setArrays(List arrays) { this.arrays = arrays; } public List getIntegers() { return integers; } public void setIntegers(List integers) { this.integers = integers; } public List getSubObjects() { return subObjects; } public void setSubObjects(List 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> getSubObjectList() { return subObjectList; } public void setSubObjectList(HashMap> subObjectList) { this.subObjectList = subObjectList; } public void addSubObjectList(String name, ModelObject object) { LinkedList list = new LinkedList(); if (subObjectList.get(name) != null){ list = subObjectList.get(name); } list.push(object); this.subObjectList.put(name, list); } public Map getTextFieldLayout() { return textFieldLayout; } public void setTextFieldLayout(Map textFieldLayout) { this.textFieldLayout = textFieldLayout; } public void addTextFieldLayout(String name, VerticalLayout vLayout){ this.textFieldLayout.put(name, vLayout); } } */