Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package fluentconditionals;
  2.  
  3. import java.util.function.Consumer;
  4. import java.util.function.Function;
  5. import java.util.function.Supplier;
  6.  
  7. public interface Conditional {
  8.     Conditional then(Runnable object);
  9.  
  10.     Conditional then(Consumer<String> stringSupplier);
  11.  
  12.     void orElse(Runnable object);
  13.  
  14.     void orElse(Consumer<String> stringSupplier);
  15.  
  16.     void orElseThrow(Supplier<RuntimeException> exceptionSupplier);
  17.  
  18.     void orElseThrowE(RuntimeException exception);
  19.  
  20.     <T> ReturnObject<T> thenReturn(Supplier<T> object);
  21.  
  22.     <T> ReturnObject<T> thenReturn(T object);
  23.  
  24.     <R> ReturnObject<R> thenReturn(Function<String, R> function);
  25.  
  26.     Conditional when(boolean condition);
  27.  
  28.     Conditional when(Supplier<Boolean> condition);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement