Package rx.functions
Class Actions
- java.lang.Object
-
- rx.functions.Actions
-
public final class Actions extends java.lang.ObjectUtility class for the Action interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description private static Actions.EmptyActionEMPTY_ACTION
-
Constructor Summary
Constructors Modifier Constructor Description privateActions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T0,T1,T2,T3,T4,T5,T6,T7,T8>
Actions.EmptyAction<T0,T1,T2,T3,T4,T5,T6,T7,T8>empty()static <T> Action1<T>toAction1(Action0 action)Wraps an Action0 instance into an Action1 instance where the latter calls the former.static Func0<java.lang.Void>toFunc(Action0 action)Converts anAction0to a function that calls the action and returnsnull.static <R> Func0<R>toFunc(Action0 action, R result)Converts anAction0to a function that calls the action and returns a specified value.static <T1> Func1<T1,java.lang.Void>toFunc(Action1<T1> action)Converts anAction1to a function that calls the action and returnsnull.static <T1,R>
Func1<T1,R>toFunc(Action1<T1> action, R result)Converts anAction1to a function that calls the action and returns a specified value.static <T1,T2>
Func2<T1,T2,java.lang.Void>toFunc(Action2<T1,T2> action)Converts anAction2to a function that calls the action and returnsnull.static <T1,T2,R>
Func2<T1,T2,R>toFunc(Action2<T1,T2> action, R result)Converts anAction2to a function that calls the action and returns a specified value.static <T1,T2,T3>
Func3<T1,T2,T3,java.lang.Void>toFunc(Action3<T1,T2,T3> action)Converts anAction3to a function that calls the action and returnsnull.static <T1,T2,T3,R>
Func3<T1,T2,T3,R>toFunc(Action3<T1,T2,T3> action, R result)Converts anAction3to a function that calls the action and returns a specified value.static <T1,T2,T3,T4>
Func4<T1,T2,T3,T4,java.lang.Void>toFunc(Action4<T1,T2,T3,T4> action)Converts anAction4to a function that calls the action and returnsnull.static <T1,T2,T3,T4,R>
Func4<T1,T2,T3,T4,R>toFunc(Action4<T1,T2,T3,T4> action, R result)Converts anAction4to a function that calls the action and returns a specified value.static <T1,T2,T3,T4,T5>
Func5<T1,T2,T3,T4,T5,java.lang.Void>toFunc(Action5<T1,T2,T3,T4,T5> action)Converts anAction5to a function that calls the action and returnsnull.static <T1,T2,T3,T4,T5,R>
Func5<T1,T2,T3,T4,T5,R>toFunc(Action5<T1,T2,T3,T4,T5> action, R result)Converts anAction5to a function that calls the action and returns a specified value.static <T1,T2,T3,T4,T5,T6>
Func6<T1,T2,T3,T4,T5,T6,java.lang.Void>toFunc(Action6<T1,T2,T3,T4,T5,T6> action)Converts anAction6to a function that calls the action and returnsnull.static <T1,T2,T3,T4,T5,T6,R>
Func6<T1,T2,T3,T4,T5,T6,R>toFunc(Action6<T1,T2,T3,T4,T5,T6> action, R result)Converts anAction6to a function that calls the action and returns a specified value.static <T1,T2,T3,T4,T5,T6,T7>
Func7<T1,T2,T3,T4,T5,T6,T7,java.lang.Void>toFunc(Action7<T1,T2,T3,T4,T5,T6,T7> action)Converts anAction7to a function that calls the action and returnsnull.static <T1,T2,T3,T4,T5,T6,T7,R>
Func7<T1,T2,T3,T4,T5,T6,T7,R>toFunc(Action7<T1,T2,T3,T4,T5,T6,T7> action, R result)Converts anAction7to a function that calls the action and returns a specified value.static <T1,T2,T3,T4,T5,T6,T7,T8>
Func8<T1,T2,T3,T4,T5,T6,T7,T8,java.lang.Void>toFunc(Action8<T1,T2,T3,T4,T5,T6,T7,T8> action)Converts anAction8to a function that calls the action and returnsnull.static <T1,T2,T3,T4,T5,T6,T7,T8,R>
Func8<T1,T2,T3,T4,T5,T6,T7,T8,R>toFunc(Action8<T1,T2,T3,T4,T5,T6,T7,T8> action, R result)Converts anAction8to a function that calls the action and returns a specified value.static <T1,T2,T3,T4,T5,T6,T7,T8,T9>
Func9<T1,T2,T3,T4,T5,T6,T7,T8,T9,java.lang.Void>toFunc(Action9<T1,T2,T3,T4,T5,T6,T7,T8,T9> action)Converts anAction9to a function that calls the action and returnsnull.static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R>
Func9<T1,T2,T3,T4,T5,T6,T7,T8,T9,R>toFunc(Action9<T1,T2,T3,T4,T5,T6,T7,T8,T9> action, R result)Converts anAction9to a function that calls the action and returns a specified value.static FuncN<java.lang.Void>toFunc(ActionN action)Converts anActionNto a function that calls the action and returnsnull.static <R> FuncN<R>toFunc(ActionN action, R result)Converts anActionNto a function that calls the action and returns a specified value.
-
-
-
Field Detail
-
EMPTY_ACTION
private static final Actions.EmptyAction EMPTY_ACTION
-
-
Method Detail
-
empty
public static <T0,T1,T2,T3,T4,T5,T6,T7,T8> Actions.EmptyAction<T0,T1,T2,T3,T4,T5,T6,T7,T8> empty()
-
toFunc
public static Func0<java.lang.Void> toFunc(Action0 action)
Converts anAction0to a function that calls the action and returnsnull.
-
toFunc
public static <T1> Func1<T1,java.lang.Void> toFunc(Action1<T1> action)
Converts anAction1to a function that calls the action and returnsnull.
-
toFunc
public static <T1,T2> Func2<T1,T2,java.lang.Void> toFunc(Action2<T1,T2> action)
Converts anAction2to a function that calls the action and returnsnull.
-
toFunc
public static <T1,T2,T3> Func3<T1,T2,T3,java.lang.Void> toFunc(Action3<T1,T2,T3> action)
Converts anAction3to a function that calls the action and returnsnull.
-
toFunc
public static <T1,T2,T3,T4> Func4<T1,T2,T3,T4,java.lang.Void> toFunc(Action4<T1,T2,T3,T4> action)
Converts anAction4to a function that calls the action and returnsnull.
-
toFunc
public static <T1,T2,T3,T4,T5> Func5<T1,T2,T3,T4,T5,java.lang.Void> toFunc(Action5<T1,T2,T3,T4,T5> action)
Converts anAction5to a function that calls the action and returnsnull.
-
toFunc
public static <T1,T2,T3,T4,T5,T6> Func6<T1,T2,T3,T4,T5,T6,java.lang.Void> toFunc(Action6<T1,T2,T3,T4,T5,T6> action)
Converts anAction6to a function that calls the action and returnsnull.
-
toFunc
public static <T1,T2,T3,T4,T5,T6,T7> Func7<T1,T2,T3,T4,T5,T6,T7,java.lang.Void> toFunc(Action7<T1,T2,T3,T4,T5,T6,T7> action)
Converts anAction7to a function that calls the action and returnsnull.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeT7- the seventh argument type- Parameters:
action- theAction7to convert- Returns:
- a
Func7that callsactionand returnsnull
-
toFunc
public static <T1,T2,T3,T4,T5,T6,T7,T8> Func8<T1,T2,T3,T4,T5,T6,T7,T8,java.lang.Void> toFunc(Action8<T1,T2,T3,T4,T5,T6,T7,T8> action)
Converts anAction8to a function that calls the action and returnsnull.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeT7- the seventh argument typeT8- the eigth argument type- Parameters:
action- theAction8to convert- Returns:
- a
Func8that callsactionand returnsnull
-
toFunc
public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Func9<T1,T2,T3,T4,T5,T6,T7,T8,T9,java.lang.Void> toFunc(Action9<T1,T2,T3,T4,T5,T6,T7,T8,T9> action)
Converts anAction9to a function that calls the action and returnsnull.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeT7- the seventh argument typeT8- the eigth argument typeT9- the ninth argument type- Parameters:
action- theAction9to convert- Returns:
- a
Func9that callsactionand returnsnull
-
toFunc
public static FuncN<java.lang.Void> toFunc(ActionN action)
Converts anActionNto a function that calls the action and returnsnull.
-
toFunc
public static <R> Func0<R> toFunc(Action0 action, R result)
Converts anAction0to a function that calls the action and returns a specified value.
-
toFunc
public static <T1,R> Func1<T1,R> toFunc(Action1<T1> action, R result)
Converts anAction1to a function that calls the action and returns a specified value.
-
toFunc
public static <T1,T2,R> Func2<T1,T2,R> toFunc(Action2<T1,T2> action, R result)
Converts anAction2to a function that calls the action and returns a specified value.
-
toFunc
public static <T1,T2,T3,R> Func3<T1,T2,T3,R> toFunc(Action3<T1,T2,T3> action, R result)
Converts anAction3to a function that calls the action and returns a specified value.
-
toFunc
public static <T1,T2,T3,T4,R> Func4<T1,T2,T3,T4,R> toFunc(Action4<T1,T2,T3,T4> action, R result)
Converts anAction4to a function that calls the action and returns a specified value.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeR- the result type- Parameters:
action- theAction4to convertresult- the value to return from the function call- Returns:
- a
Func4that callsactionand returnsresult
-
toFunc
public static <T1,T2,T3,T4,T5,R> Func5<T1,T2,T3,T4,T5,R> toFunc(Action5<T1,T2,T3,T4,T5> action, R result)
Converts anAction5to a function that calls the action and returns a specified value.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeR- the result type- Parameters:
action- theAction5to convertresult- the value to return from the function call- Returns:
- a
Func5that callsactionand returnsresult
-
toFunc
public static <T1,T2,T3,T4,T5,T6,R> Func6<T1,T2,T3,T4,T5,T6,R> toFunc(Action6<T1,T2,T3,T4,T5,T6> action, R result)
Converts anAction6to a function that calls the action and returns a specified value.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeR- the result type- Parameters:
action- theAction6to convertresult- the value to return from the function call- Returns:
- a
Func6that callsactionand returnsresult
-
toFunc
public static <T1,T2,T3,T4,T5,T6,T7,R> Func7<T1,T2,T3,T4,T5,T6,T7,R> toFunc(Action7<T1,T2,T3,T4,T5,T6,T7> action, R result)
Converts anAction7to a function that calls the action and returns a specified value.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeT7- the seventh argument typeR- the result type- Parameters:
action- theAction7to convertresult- the value to return from the function call- Returns:
- a
Func7that callsactionand returnsresult
-
toFunc
public static <T1,T2,T3,T4,T5,T6,T7,T8,R> Func8<T1,T2,T3,T4,T5,T6,T7,T8,R> toFunc(Action8<T1,T2,T3,T4,T5,T6,T7,T8> action, R result)
Converts anAction8to a function that calls the action and returns a specified value.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeT7- the seventh argument typeT8- the eigth argument typeR- the result type- Parameters:
action- theAction8to convertresult- the value to return from the function call- Returns:
- a
Func8that callsactionand returnsresult
-
toFunc
public static <T1,T2,T3,T4,T5,T6,T7,T8,T9,R> Func9<T1,T2,T3,T4,T5,T6,T7,T8,T9,R> toFunc(Action9<T1,T2,T3,T4,T5,T6,T7,T8,T9> action, R result)
Converts anAction9to a function that calls the action and returns a specified value.- Type Parameters:
T1- the first argument typeT2- the second argument typeT3- the third argument typeT4- the fourth argument typeT5- the fifth argument typeT6- the sixth argument typeT7- the seventh argument typeT8- the eigth argument typeT9- the ninth argument typeR- the result type- Parameters:
action- theAction9to convertresult- the value to return from the function call- Returns:
- a
Func9that callsactionand returnsresult
-
toFunc
public static <R> FuncN<R> toFunc(ActionN action, R result)
Converts anActionNto a function that calls the action and returns a specified value.
-
-