From 35aae3aed0a1b24eb21aadc35858fac052e4873f Mon Sep 17 00:00:00 2001 From: fickludd Date: Fri, 10 Mar 2017 22:26:01 +0100 Subject: [PATCH] Use standard ThrowingConsumer instead of custom interface --- .../impl/api/schema/NodeSchemaMatcher.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/schema/NodeSchemaMatcher.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/schema/NodeSchemaMatcher.java index 576a2e75c7226..2a64c8665eed5 100644 --- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/schema/NodeSchemaMatcher.java +++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/schema/NodeSchemaMatcher.java @@ -23,9 +23,9 @@ import org.neo4j.collection.primitive.Primitive; import org.neo4j.collection.primitive.PrimitiveIntSet; +import org.neo4j.function.ThrowingConsumer; import org.neo4j.kernel.api.schema_new.LabelSchemaDescriptor; import org.neo4j.kernel.api.schema_new.LabelSchemaSupplier; -import org.neo4j.kernel.api.schema_new.SchemaDescriptor; import org.neo4j.kernel.impl.api.KernelStatement; import org.neo4j.kernel.impl.api.operations.EntityReadOperations; import org.neo4j.storageengine.api.NodeItem; @@ -43,7 +43,7 @@ public NodeSchemaMatcher( EntityReadOperations readOps ) } /** - * Iterate over some schema suppliers, and invoke an action for every supplier that matches the node. To match the + * Iterate over some schema suppliers, and invoke a callback for every supplier that matches the node. To match the * node N the supplier must supply a LabelSchemaDescriptor D, such that N has the label of D, and values for all * the properties of D. * @@ -55,7 +55,7 @@ public NodeSchemaMatcher( EntityReadOperations readOps ) * @param node The node * @param specialPropertyId This property id will always count as a match for the descriptor, regardless of * whether the node has this property or not - * @param action The action to take on match + * @param callback The action to take on match * @param the type to match. Must implement LabelSchemaDescriptor.Supplier * @param The type of exception that can be thrown when taking the action * @throws EXCEPTION This exception is propagated from the action @@ -65,7 +65,7 @@ public void o Iterator schemaSuppliers, NodeItem node, int specialPropertyId, - SchemaMatchAction action + ThrowingConsumer callback ) throws EXCEPTION { PrimitiveIntSet nodePropertyIds = null; @@ -83,7 +83,7 @@ public void o if ( nodeHasSchemaProperties( nodePropertyIds, schema.getPropertyIds(), specialPropertyId ) ) { - action.act( schemaSupplier ); + callback.accept( schemaSupplier ); } } } @@ -101,10 +101,4 @@ public static boolean nodeHasSchemaProperties( } return true; } - - public interface SchemaMatchAction - { - void act( SUPPLIER schemaSupplier ) throws EXCEPTION; - } - }