Added support for Multiple Edges
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / serialization / db / EdgeRule.java
index 309dbff..ae9e96c 100644 (file)
@@ -1,43 +1,43 @@
-/**
+/*-
  * ============LICENSE_START=======================================================
  * org.onap.aai
  * ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * 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
- *
+ * 
+ *      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=========================================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
-package org.onap.aai.serialization.db;
 
-import org.apache.tinkerpop.gremlin.structure.Direction;
+package org.onap.aai.serialization.db;
 
-import java.util.HashMap;
+import java.util.EnumMap;
 import java.util.Map;
 
+import org.apache.tinkerpop.gremlin.structure.Direction;
+
 public class EdgeRule {
 
        private String label = "";
        private MultiplicityRule multiplicityRule = null;
        private Direction direction = null;
        private Map<EdgeProperty, String> edgeProperties = null;
+       private boolean isDefaultEdge = false;
        
        /**
         * Instantiates a new edge rule.
         */
        public EdgeRule() {
-               edgeProperties = new HashMap<>();
+               edgeProperties = new EnumMap<>(EdgeProperty.class);
        }
        
        /**
@@ -206,6 +206,18 @@ public class EdgeRule {
        private String getProp(EdgeProperty key) {
                return this.edgeProperties.get(key);
        }
+
+       public boolean isDefault() {
+               return isDefaultEdge;
+       }
+       
+       public void setIsDefault(boolean isDefault) {
+               this.isDefaultEdge = isDefault;
+       }
+       
+       public void setIsDefault(String isDefault) {
+               this.isDefaultEdge = "true".equals(isDefault);
+       }
        
        
 }