| 119 | } |
| 120 | |
| 121 | @Override |
| 122 | public Map<String, Object> propertiesMap() { |
| 123 | final Map<String, Object> properties; |
| 124 | if (inBlockOffset != -1) { |
| 125 | properties = inNode.get().edgePropertyMap(Direction.IN, this, getInBlockOffset()); |
| 126 | } else if (outBlockOffset != -1) { |
| 127 | properties = outNode.get().edgePropertyMap(Direction.OUT, this, getOutBlockOffset()); |
| 128 | } else { |
| 129 | throw new RuntimeException("Cannot get properties. In and out block offset uninitialized."); |
| 130 | } |
| 131 | |
| 132 | for (String key : propertyKeys()) { |
| 133 | if (!properties.containsKey(key)) { |
| 134 | final Object defaultValue = propertyDefaultValue(key); |
| 135 | if (defaultValue != null) { |
| 136 | properties.put(key, propertyDefaultValue(key)); |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | return properties; |
| 141 | } |
| 142 | |
| 143 | public Object property(String propertyKey) { |
| 144 | final Object value; |