Skip to content

Instantly share code, notes, and snippets.

@gszeliga
Created December 9, 2015 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gszeliga/ce7c95f4aa7f98e4bce4 to your computer and use it in GitHub Desktop.
Save gszeliga/ce7c95f4aa7f98e4bce4 to your computer and use it in GitHub Desktop.
public static class CompositionSources<B>
{
private CompositionSources(){ }
public interface Partial<B>
{
CompletableFuture<Outcome<B>> apply(CompletableFuture<Outcome<B>> b);
}
public interface MergingStage<B, V>{
Partial<B> by(BiFunction<Outcome<B>, Outcome<V>, Outcome<B>> f);
}
public <V> MergingStage<B, V> value(CompletableFuture<Outcome<V>> value){
return f -> builder
-> builder.thenCombine(value, (b, v) -> f.apply(b, v)
.dependingOn(b)
.dependingOn(v));
}
public static <B> CompositionSources<B> stickedTo(Class<B> clazz)
{
return new CompositionSources<>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment