@param convertPropertyForPersistence applied to all element property values by @NodeSerializer prior to persisting nodes/edges. That's useful if your runtime types are not supported by plain java, e.g. because you're u
(Config configuration,
List<NodeFactory<?>> nodeFactories,
List<EdgeFactory<?>> edgeFactories,
Function<Object, Object> convertPropertyForPersistence)
| 43 | * supported by plain java, e.g. because you're using Scala Seq etc. |
| 44 | */ |
| 45 | public static Graph open(Config configuration, |
| 46 | List<NodeFactory<?>> nodeFactories, |
| 47 | List<EdgeFactory<?>> edgeFactories, |
| 48 | Function<Object, Object> convertPropertyForPersistence) { |
| 49 | Map<String, NodeFactory> nodeFactoryByLabel = new HashMap<>(nodeFactories.size()); |
| 50 | Map<String, EdgeFactory> edgeFactoryByLabel = new HashMap<>(edgeFactories.size()); |
| 51 | nodeFactories.forEach(factory -> nodeFactoryByLabel.put(factory.forLabel(), factory)); |
| 52 | edgeFactories.forEach(factory -> edgeFactoryByLabel.put(factory.forLabel(), factory)); |
| 53 | return new Graph(configuration, nodeFactoryByLabel, edgeFactoryByLabel, convertPropertyForPersistence); |
| 54 | } |
| 55 | |
| 56 | public static Graph open(Config configuration, |
| 57 | List<NodeFactory<?>> nodeFactories, |