Package rx.functions
Class Actions
- java.lang.Object
-
- rx.functions.Actions
-
public final class Actions extends java.lang.Object
Utility class for the Action interfaces.
-
-
Field Summary
Fields Modifier and Type Field Description private static Actions.EmptyAction
EMPTY_ACTION
-
Constructor Summary
Constructors Modifier Constructor Description private
Actions()
-
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 anAction0
to a function that calls the action and returnsnull
.static <R> Func0<R>
toFunc(Action0 action, R result)
Converts anAction0
to a function that calls the action and returns a specified value.static <T1> Func1<T1,java.lang.Void>
toFunc(Action1<T1> action)
Converts anAction1
to a function that calls the action and returnsnull
.static <T1,R>
Func1<T1,R>toFunc(Action1<T1> action, R result)
Converts anAction1
to 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 anAction2
to a function that calls the action and returnsnull
.static <T1,T2,R>
Func2<T1,T2,R>toFunc(Action2<T1,T2> action, R result)
Converts anAction2
to 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 anAction3
to 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 anAction3
to 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 anAction4
to 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 anAction4
to 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 anAction5
to 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 anAction5
to 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 anAction6
to 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 anAction6
to 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 anAction7
to 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 anAction7
to 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 anAction8
to 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 anAction8
to 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 anAction9
to 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 anAction9
to a function that calls the action and returns a specified value.static FuncN<java.lang.Void>
toFunc(ActionN action)
Converts anActionN
to a function that calls the action and returnsnull
.static <R> FuncN<R>
toFunc(ActionN action, R result)
Converts anActionN
to 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 anAction0
to a function that calls the action and returnsnull
.
-
toFunc
public static <T1> Func1<T1,java.lang.Void> toFunc(Action1<T1> action)
Converts anAction1
to 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 anAction2
to 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 anAction3
to 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 anAction4
to 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 anAction5
to 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 anAction6
to 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 anAction7
to 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
- theAction7
to convert- Returns:
- a
Func7
that callsaction
and 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 anAction8
to 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
- theAction8
to convert- Returns:
- a
Func8
that callsaction
and 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 anAction9
to 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
- theAction9
to convert- Returns:
- a
Func9
that callsaction
and returnsnull
-
toFunc
public static FuncN<java.lang.Void> toFunc(ActionN action)
Converts anActionN
to a function that calls the action and returnsnull
.
-
toFunc
public static <R> Func0<R> toFunc(Action0 action, R result)
Converts anAction0
to 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 anAction1
to 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 anAction2
to 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 anAction3
to 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 anAction4
to 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
- theAction4
to convertresult
- the value to return from the function call- Returns:
- a
Func4
that callsaction
and 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 anAction5
to 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
- theAction5
to convertresult
- the value to return from the function call- Returns:
- a
Func5
that callsaction
and 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 anAction6
to 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
- theAction6
to convertresult
- the value to return from the function call- Returns:
- a
Func6
that callsaction
and 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 anAction7
to 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
- theAction7
to convertresult
- the value to return from the function call- Returns:
- a
Func7
that callsaction
and 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 anAction8
to 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
- theAction8
to convertresult
- the value to return from the function call- Returns:
- a
Func8
that callsaction
and 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 anAction9
to 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
- theAction9
to convertresult
- the value to return from the function call- Returns:
- a
Func9
that callsaction
and returnsresult
-
toFunc
public static <R> FuncN<R> toFunc(ActionN action, R result)
Converts anActionN
to a function that calls the action and returns a specified value.
-
-