Package com.microstrategy.utils.function
Class FunctionalAction
- java.lang.Object
-
- com.microstrategy.utils.function.FunctionalAction
-
public class FunctionalAction extends java.lang.Object
Utility methods for performing a functional operation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,X extends java.lang.Exception>
voidperform(ThrowingConsumer<T,X> action, T input, java.lang.Class<X> exceptionClass)
Perform aThrowingConsumer
operation that accepts a single input argument and returns no result.static <T1,T2,T3,X extends java.lang.Exception>
voidperform(ThrowingConsumer3<? super T1,? super T2,? super T3,X> action, T1 input1, T2 input2, T3 input3, java.lang.Class<X> exceptionClass)
Perform aThrowingConsumer3
operation that accepts three input arguments and returns no result.static <T,U>
voidperform(java.util.function.BiConsumer<T,U> action, T input1, U input2)
Perform aBiConsumer
operation that accepts two input arguments and returns no result.static <T> void
perform(java.util.function.Consumer<? super T> action, T input)
Perform aConsumer
operation that accepts a single input argument and returns no result.static <K,V,R>
RperformBiFunc(java.util.function.BiFunction<? super K,? super V,? extends R> action, K input1, V input2)
Perform aBiFunction
operation that accepts two argument and produces a result.static <T,R>
RperformFunc(java.util.function.Function<? super T,? extends R> action, T input)
Perform aFunction
operation that accepts one argument and produces a result.static <T,X extends java.lang.Exception>
TperformGet(ThrowingSupplier<T,X> action, java.lang.Class<X> exceptionClass)
Perform aThrowingSupplier
operation that accepts no argument and returns one result.
-
-
-
Method Detail
-
perform
public static <T> void perform(java.util.function.Consumer<? super T> action, T input)
Perform aConsumer
operation that accepts a single input argument and returns no result.- Type Parameters:
T
- the type of the input to the Consumer operation
-
performGet
public static <T,X extends java.lang.Exception> T performGet(ThrowingSupplier<T,X> action, java.lang.Class<X> exceptionClass) throws X extends java.lang.Exception
Perform aThrowingSupplier
operation that accepts no argument and returns one result.- Type Parameters:
T
- the type of the output to the ThrowingSupplier operationX
- the type of exception could be thrown from the ThrowingSupplier operation- Throws:
X extends java.lang.Exception
-
perform
public static <T,X extends java.lang.Exception> void perform(ThrowingConsumer<T,X> action, T input, java.lang.Class<X> exceptionClass) throws X extends java.lang.Exception
Perform aThrowingConsumer
operation that accepts a single input argument and returns no result.- Type Parameters:
T
- the type of the input to the ThrowingConsumer operationX
- the type of exception could be thrown from the ThrowingConsumer operation- Throws:
X extends java.lang.Exception
-
perform
public static <T,U> void perform(java.util.function.BiConsumer<T,U> action, T input1, U input2)
Perform aBiConsumer
operation that accepts two input arguments and returns no result.- Type Parameters:
T
- the type of the first input to the BiConsumer operationU
- the type of the second input to the BiConsumer operation
-
perform
public static <T1,T2,T3,X extends java.lang.Exception> void perform(ThrowingConsumer3<? super T1,? super T2,? super T3,X> action, T1 input1, T2 input2, T3 input3, java.lang.Class<X> exceptionClass) throws X extends java.lang.Exception
Perform aThrowingConsumer3
operation that accepts three input arguments and returns no result.- Type Parameters:
T1
- the type of the first input to the ThrowingConsumer3 operationT2
- the type of the second input to the ThrowingConsumer3 operationT3
- the type of the third input to the ThrowingConsumer3 operationX
- the type of exception could be thrown from the ThrowingConsumer3 operation- Throws:
X extends java.lang.Exception
-
performFunc
public static <T,R> R performFunc(java.util.function.Function<? super T,? extends R> action, T input)
Perform aFunction
operation that accepts one argument and produces a result.- Type Parameters:
T
- the type of the inputR
- the type of the result
-
performBiFunc
public static <K,V,R> R performBiFunc(java.util.function.BiFunction<? super K,? super V,? extends R> action, K input1, V input2)
Perform aBiFunction
operation that accepts two argument and produces a result.- Type Parameters:
K
- the type of the first inputV
- the type of the second inputR
- the type of the result
-
-