Skip to content

Commit

Permalink
Remove deprecated Functions: fromConsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Mar 21, 2016
1 parent d6bfbc3 commit cbbcefb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Expand Up @@ -20,7 +20,6 @@
package org.neo4j.function;

import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;

/**
Expand Down Expand Up @@ -70,11 +69,4 @@ public static <T1, T2> BiFunction<? super BiFunction<T1,T2,T1>,? super BiFunctio
}
};

public static <T> Function<T,Void> fromConsumer( final Consumer<T> consumer )
{
return t -> {
consumer.accept( t );
return null;
};
}
}
Expand Up @@ -27,7 +27,6 @@
import java.util.function.Function;
import java.util.function.Supplier;

import org.neo4j.function.Functions;
import org.neo4j.graphdb.DependencyResolver;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
Expand Down Expand Up @@ -82,7 +81,10 @@ public <T> T when( Function<GraphDatabaseService, T> function )

public void executeAndCommit( Consumer<? super GraphDatabaseService> consumer )
{
transaction( Functions.fromConsumer( consumer ), true );
transaction( (Function<? super GraphDatabaseService,Void>) t -> {
consumer.accept( t );
return null;
}, true );
}

public <T> T executeAndCommit( Function<? super GraphDatabaseService, T> function )
Expand Down

0 comments on commit cbbcefb

Please sign in to comment.