Class FunctionTagging


  • public final class FunctionTagging
    extends java.lang.Object
    Wraps the regular io.reactivex.functions function types and appends the user-specified tag to the exception the wrapped function produces.

    The tagging can be optionally enabled before assembling flows, thus the overhead can be limited to when diagnosing problems around failing functions.

    Each functional type has its own {code tagX} postfix to avoid lambda ambiguity.

    Since:
    0.17.4
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FunctionTagging.FunctionTaggingException
      The stackless tagging exception appended to the chain of causes of the original exception thrown by the wrapped function.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void disable()
      Disable the function tagging wrappers in the tagX methods.
      static void enable()
      Enable the function tagging wrappers in the tagX methods.
      static boolean isEnabled()
      Returns true if the function tagging wrappers are enabled.
      static <T1,​T2,​R>
      BiFunction<T1,​T2,​R>
      tagBiFunction​(BiFunction<T1,​T2,​R> func, java.lang.String tag)  
      static <T,​R>
      Function<T,​R>
      tagFunction​(Function<T,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​R>
      Function3<T1,​T2,​T3,​R>
      tagFunction3​(Function3<T1,​T2,​T3,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​T4,​R>
      Function4<T1,​T2,​T3,​T4,​R>
      tagFunction4​(Function4<T1,​T2,​T3,​T4,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​T4,​T5,​R>
      Function5<T1,​T2,​T3,​T4,​T5,​R>
      tagFunction5​(Function5<T1,​T2,​T3,​T4,​T5,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​T4,​T5,​T6,​R>
      Function6<T1,​T2,​T3,​T4,​T5,​T6,​R>
      tagFunction6​(Function6<T1,​T2,​T3,​T4,​T5,​T6,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​R>
      Function7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​R>
      tagFunction7​(Function7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R>
      Function8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R>
      tagFunction8​(Function8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R> func, java.lang.String tag)  
      static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R>
      Function9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R>
      tagFunction9​(Function9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R> func, java.lang.String tag)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • enable

        public static void enable()
        Enable the function tagging wrappers in the tagX methods.
      • disable

        public static void disable()
        Disable the function tagging wrappers in the tagX methods.

        Note that disabling doesn't remove the wrappers from previously tagged functions.

      • isEnabled

        public static boolean isEnabled()
        Returns true if the function tagging wrappers are enabled.
        Returns:
        true if the function tagging wrappers are enabled
      • tagFunction

        public static <T,​R> Function<T,​R> tagFunction​(Function<T,​R> func,
                                                                  java.lang.String tag)
      • tagBiFunction

        public static <T1,​T2,​R> BiFunction<T1,​T2,​R> tagBiFunction​(BiFunction<T1,​T2,​R> func,
                                                                                          java.lang.String tag)
      • tagFunction3

        public static <T1,​T2,​T3,​R> Function3<T1,​T2,​T3,​R> tagFunction3​(Function3<T1,​T2,​T3,​R> func,
                                                                                                          java.lang.String tag)
      • tagFunction4

        public static <T1,​T2,​T3,​T4,​R> Function4<T1,​T2,​T3,​T4,​R> tagFunction4​(Function4<T1,​T2,​T3,​T4,​R> func,
                                                                                                                            java.lang.String tag)
      • tagFunction5

        public static <T1,​T2,​T3,​T4,​T5,​R> Function5<T1,​T2,​T3,​T4,​T5,​R> tagFunction5​(Function5<T1,​T2,​T3,​T4,​T5,​R> func,
                                                                                                                                              java.lang.String tag)
      • tagFunction6

        public static <T1,​T2,​T3,​T4,​T5,​T6,​R> Function6<T1,​T2,​T3,​T4,​T5,​T6,​R> tagFunction6​(Function6<T1,​T2,​T3,​T4,​T5,​T6,​R> func,
                                                                                                                                                                java.lang.String tag)
      • tagFunction7

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​R> Function7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​R> tagFunction7​(Function7<T1,​T2,​T3,​T4,​T5,​T6,​T7,​R> func,
                                                                                                                                                                                  java.lang.String tag)
      • tagFunction8

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R> Function8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R> tagFunction8​(Function8<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​R> func,
                                                                                                                                                                                                    java.lang.String tag)
      • tagFunction9

        public static <T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R> Function9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R> tagFunction9​(Function9<T1,​T2,​T3,​T4,​T5,​T6,​T7,​T8,​T9,​R> func,
                                                                                                                                                                                                                      java.lang.String tag)