Class Switch


  • public final class Switch
    extends Object
    Class to implement switch functionally based on an Object's class
    • Method Detail

      • switchType

        public static <T> void switchType​(Object object,
                                          Consumer... consumers)
        Method to implement a "switch" based on an Object's class
        Type Parameters:
        T -
        Parameters:
        object -
        consumers -
      • switchCase

        public static <T> Consumer switchCase​(Class<T> clazz,
                                              Consumer<T> consumer)
        Method to implement a switch "case" based on an Object's class
        Type Parameters:
        T -
        Parameters:
        clazz -
        consumer -
        Returns: