2  * Copyright 2016 [ZTE] and others.
 
   4  * Licensed under the Apache License, Version 2.0 (the "License");
 
   5  * you may not use this file except in compliance with the License.
 
   6  * You may obtain a copy of the License at
 
   8  *     http://www.apache.org/licenses/LICENSE-2.0
 
  10  * Unless required by applicable law or agreed to in writing, software
 
  11  * distributed under the License is distributed on an "AS IS" BASIS,
 
  12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  13  * See the License for the specific language governing permissions and
 
  14  * limitations under the License.
 
  17 package org.openo.commontosca.catalog.model.parser.yaml.aria.entity;
 
  19 import java.util.HashMap;
 
  21 import java.util.Map.Entry;
 
  23 import lombok.AllArgsConstructor;
 
  25 import lombok.NoArgsConstructor;
 
  27 import com.google.gson.JsonObject;
 
  32 public class AriaParserResult {
 
  33   private String description;
 
  34   private Map<String, String> metadata;
 
  36   private JsonObject groups;
 
  37   private JsonObject policies;
 
  38   private Substitution substitution;
 
  39   private Map<String, Input> inputs;
 
  40   private Map<String, Output> outpus;
 
  43   public class Substitution {
 
  44     private String node_type_name;
 
  45     private Mapping[] requirement;
 
  46     private Mapping[] capabilities;
 
  49     public class Mapping {
 
  50       private String mapped_name;
 
  51       private String node_id;
 
  59     private String type_name;
 
  61     private String description;
 
  66     private String type_name;
 
  68     private String description;
 
  75     private String type_name;
 
  76     private Map<String, Property> properties;
 
  77     private JsonObject[] interfaces;
 
  78     private JsonObject[] artifacts;
 
  79     private JsonObject[] capabilities;
 
  80     private Relationship[] relationships;
 
  83     public class Property {
 
  84       private String type_name;
 
  86       private String description;
 
  90     public class Relationship {
 
  91       private String target_node_id;
 
  92       private String target_capability_name;
 
  93       private String type_name;
 
  94       private String template_name;
 
  95       private Map<String, Property> properties;
 
  96       private JsonObject[] source_interfaces;
 
  97       private JsonObject[] target_interfaces;
 
 100       public class Property {
 
 101         private String type_name;
 
 102         private Object value;
 
 103         private String description;
 
 110     public Map<String, Object> getPropertyAssignments() {
 
 111       if (this.properties == null || this.properties.isEmpty()) {
 
 112         return new HashMap<String, Object>();
 
 115       Map<String, Object> ret = new HashMap<String, Object>();
 
 116       for (Entry<String, Property> e : this.properties.entrySet()) {
 
 117         ret.put(e.getKey(), e.getValue().getValue());