Class Actions



  • public final class Actions
    extends Object
    Utility class for the Action interfaces.
    • Method Summary

      Methods

      Modifier and Type Method and Description
      static <T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> rx.functions.Actions.EmptyAction<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> empty()
       
      static Func0<Void> toFunc(Action0 action)
      Converts an Action0 to a function that calls the action and returns null.
      static <R> Func0<R> toFunc(Action0 action, R result)
      Converts an Action0 to a function that calls the action and returns a specified value.
      static <T1> Func1<T1,Void> toFunc(Action1<T1> action)
      Converts an Action1 to a function that calls the action and returns null.
      static <T1,R> Func1<T1,R> toFunc(Action1<T1> action, R result)
      Converts an Action1 to a function that calls the action and returns a specified value.
      static <T1,T2> Func2<T1,T2,Void> toFunc(Action2<T1,T2> action)
      Converts an Action2 to a function that calls the action and returns null.
      static <T1,T2,R> Func2<T1,T2,R> toFunc(Action2<T1,T2> action, R result)
      Converts an Action2 to a function that calls the action and returns a specified value.
      static <T1,T2,T3> Func3<T1,T2,T3,Void> toFunc(Action3<T1,T2,T3> action)
      Converts an Action3 to a function that calls the action and returns null.
      static <T1,T2,T3,R> Func3<T1,T2,T3,R> toFunc(Action3<T1,T2,T3> action, R result)
      Converts an Action3 to a function that calls the action and returns a specified value.
      static <T1,T2,T3,T4> Func4<T1,T2,T3,T4,Void> toFunc(Action4<T1,T2,T3,T4> action)
      Converts an Action4 to a function that calls the action and returns null.
      static <T1,T2,T3,T4,R> Func4<T1,T2,T3,T4,R> toFunc(Action4<T1,T2,T3,T4> action, R result)
      Converts an Action4 to a function that calls the action and returns a specified value.
      static <T1,T2,T3,T4,T5> Func5<T1,T2,T3,T4,T5,Void> toFunc(Action5<T1,T2,T3,T4,T5> action)
      Converts an Action5 to a function that calls the action and returns null.
      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 an Action5 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,Void> toFunc(Action6<T1,T2,T3,T4,T5,T6> action)
      Converts an Action6 to a function that calls the action and returns null.
      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 an Action6 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,Void> toFunc(Action7<T1,T2,T3,T4,T5,T6,T7> action)
      Converts an Action7 to a function that calls the action and returns null.
      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 an Action7 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,Void> toFunc(Action8<T1,T2,T3,T4,T5,T6,T7,T8> action)
      Converts an Action8 to a function that calls the action and returns null.
      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 an Action8 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,Void> toFunc(Action9<T1,T2,T3,T4,T5,T6,T7,T8,T9> action)
      Converts an Action9 to a function that calls the action and returns null.
      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 an Action9 to a function that calls the action and returns a specified value.
      static FuncN<Void> toFunc(ActionN action)
      Converts an ActionN to a function that calls the action and returns null.
      static <R> FuncN<R> toFunc(ActionN action, R result)
      Converts an ActionN to a function that calls the action and returns a specified value.
    • Method Detail

      • empty

        public static final <T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> rx.functions.Actions.EmptyAction<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> empty()
      • toFunc

        public static Func0<Void> toFunc(Action0 action)
        Converts an Action0 to a function that calls the action and returns null.
        Parameters:
        action - the Action0 to convert
        Returns:
        a Func0 that calls action and returns null
      • toFunc

        public static <T1> Func1<T1,Void> toFunc(Action1<T1> action)
        Converts an Action1 to a function that calls the action and returns null.
        Parameters:
        action - the Action1 to convert
        Returns:
        a Func1 that calls action and returns null
      • toFunc

        public static <T1,T2> Func2<T1,T2,Void> toFunc(Action2<T1,T2> action)
        Converts an Action2 to a function that calls the action and returns null.
        Parameters:
        action - the Action2 to convert
        Returns:
        a Func2 that calls action and returns null
      • toFunc

        public static <T1,T2,T3> Func3<T1,T2,T3,Void> toFunc(Action3<T1,T2,T3> action)
        Converts an Action3 to a function that calls the action and returns null.
        Parameters:
        action - the Action3 to convert
        Returns:
        a Func3 that calls action and returns null
      • toFunc

        public static <T1,T2,T3,T4> Func4<T1,T2,T3,T4,Void> toFunc(Action4<T1,T2,T3,T4> action)
        Converts an Action4 to a function that calls the action and returns null.
        Parameters:
        action - the Action4 to convert
        Returns:
        a Func4 that calls action and returns null
      • toFunc

        public static <T1,T2,T3,T4,T5> Func5<T1,T2,T3,T4,T5,Void> toFunc(Action5<T1,T2,T3,T4,T5> action)
        Converts an Action5 to a function that calls the action and returns null.
        Parameters:
        action - the Action5 to convert
        Returns:
        a Func5 that calls action and returns null
      • toFunc

        public static <T1,T2,T3,T4,T5,T6> Func6<T1,T2,T3,T4,T5,T6,Void> toFunc(Action6<T1,T2,T3,T4,T5,T6> action)
        Converts an Action6 to a function that calls the action and returns null.
        Parameters:
        action - the Action6 to convert
        Returns:
        a Func6 that calls action and returns null
      • toFunc

        public static <T1,T2,T3,T4,T5,T6,T7> Func7<T1,T2,T3,T4,T5,T6,T7,Void> toFunc(Action7<T1,T2,T3,T4,T5,T6,T7> action)
        Converts an Action7 to a function that calls the action and returns null.
        Parameters:
        action - the Action7 to convert
        Returns:
        a Func7 that calls action and returns null
      • toFunc

        public static <T1,T2,T3,T4,T5,T6,T7,T8> Func8<T1,T2,T3,T4,T5,T6,T7,T8,Void> toFunc(Action8<T1,T2,T3,T4,T5,T6,T7,T8> action)
        Converts an Action8 to a function that calls the action and returns null.
        Parameters:
        action - the Action8 to convert
        Returns:
        a Func8 that calls action and returns null
      • toFunc

        public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Func9<T1,T2,T3,T4,T5,T6,T7,T8,T9,Void> toFunc(Action9<T1,T2,T3,T4,T5,T6,T7,T8,T9> action)
        Converts an Action9 to a function that calls the action and returns null.
        Parameters:
        action - the Action9 to convert
        Returns:
        a Func9 that calls action and returns null
      • toFunc

        public static FuncN<Void> toFunc(ActionN action)
        Converts an ActionN to a function that calls the action and returns null.
        Parameters:
        action - the ActionN to convert
        Returns:
        a FuncN that calls action and returns null
      • toFunc

        public static <R> Func0<R> toFunc(Action0 action,
                                          R result)
        Converts an Action0 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action0 to convert
        result - the value to return from the function call
        Returns:
        a Func0 that calls action and returns result
      • toFunc

        public static <T1,R> Func1<T1,R> toFunc(Action1<T1> action,
                                                R result)
        Converts an Action1 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action1 to convert
        result - the value to return from the function call
        Returns:
        a Func1 that calls action and returns result
      • toFunc

        public static <T1,T2,R> Func2<T1,T2,R> toFunc(Action2<T1,T2> action,
                                                      R result)
        Converts an Action2 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action2 to convert
        result - the value to return from the function call
        Returns:
        a Func2 that calls action and returns result
      • toFunc

        public static <T1,T2,T3,R> Func3<T1,T2,T3,R> toFunc(Action3<T1,T2,T3> action,
                                                            R result)
        Converts an Action3 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action3 to convert
        result - the value to return from the function call
        Returns:
        a Func3 that calls action and returns result
      • toFunc

        public static <T1,T2,T3,T4,R> Func4<T1,T2,T3,T4,R> toFunc(Action4<T1,T2,T3,T4> action,
                                                                  R result)
        Converts an Action4 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action4 to convert
        result - the value to return from the function call
        Returns:
        a Func4 that calls action and returns result
      • 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 an Action5 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action5 to convert
        result - the value to return from the function call
        Returns:
        a Func5 that calls action and returns result
      • 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 an Action6 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action6 to convert
        result - the value to return from the function call
        Returns:
        a Func6 that calls action and returns result
      • 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 an Action7 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action7 to convert
        result - the value to return from the function call
        Returns:
        a Func7 that calls action and returns result
      • 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 an Action8 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action8 to convert
        result - the value to return from the function call
        Returns:
        a Func8 that calls action and returns result
      • 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 an Action9 to a function that calls the action and returns a specified value.
        Parameters:
        action - the Action9 to convert
        result - the value to return from the function call
        Returns:
        a Func9 that calls action and returns result
      • toFunc

        public static <R> FuncN<R> toFunc(ActionN action,
                                          R result)
        Converts an ActionN to a function that calls the action and returns a specified value.
        Parameters:
        action - the ActionN to convert
        result - the value to return from the function call
        Returns:
        a FuncN that calls action and returns result