Search in sources :

Example 1 with FF4jNeo4jLabels

use of org.ff4j.neo4j.FF4jNeo4jLabels in project ff4j by ff4j.

the class FeatureStoreNeo4J method addNeighBour2Feature.

/**
 * Parse node related to feature and create sub component.
 *
 * @param targetFeature
 *      current feature
 * @param nodeOther
 *      current neighbour
 */
private void addNeighBour2Feature(Feature targetFeature, Node nodeOther) {
    Util.assertNotNull(targetFeature);
    if (nodeOther != null && nodeOther.getLabels().iterator().hasNext()) {
        String nodeLabel = nodeOther.getLabels().iterator().next().toString();
        FF4jNeo4jLabels lblb = FF4jNeo4jLabels.valueOf(nodeLabel);
        switch(lblb) {
            case FF4J_FLIPPING_STRATEGY:
                FlippingStrategy fs = fromNode2FlippingStrategy(targetFeature.getUid(), nodeOther);
                targetFeature.setFlippingStrategy(fs);
                break;
            case FF4J_FEATURE_PROPERTY:
                Property<?> ap = fromNode2Property(nodeOther);
                targetFeature.getCustomProperties().put(ap.getName(), ap);
                break;
            case FF4J_FEATURE_GROUP:
                targetFeature.setGroup((String) nodeOther.getProperty(NODEGROUP_ATT_NAME));
                break;
            default:
                break;
        }
    }
}
Also used : Neo4jMapper.fromNode2FlippingStrategy(org.ff4j.neo4j.mapper.Neo4jMapper.fromNode2FlippingStrategy) FlippingStrategy(org.ff4j.core.FlippingStrategy) FF4jNeo4jLabels(org.ff4j.neo4j.FF4jNeo4jLabels)

Aggregations

FlippingStrategy (org.ff4j.core.FlippingStrategy)1 FF4jNeo4jLabels (org.ff4j.neo4j.FF4jNeo4jLabels)1 Neo4jMapper.fromNode2FlippingStrategy (org.ff4j.neo4j.mapper.Neo4jMapper.fromNode2FlippingStrategy)1