Enum AsyncUtils

    • Method Detail

      • values

        public static AsyncUtils[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (AsyncUtils c : AsyncUtils.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AsyncUtils valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • block

        public static <T> T block​(CompletableFuture<T> input)
        Helper method to wrap an async call into a blocking one and make sure to convert all checked exceptions into their correct runtime counterparts.
        Type Parameters:
        T - the generic type to return.
        Parameters:
        input - the future as input.
        Returns:
        blocks and completes on the given future while converting checked exceptions.