Class Que<T>

  • Type Parameters:
    T - type.
    All Implemented Interfaces:
    Serializable

    public final class Que<T>
    extends Object
    implements Serializable
    This is Que gotten from the word Cue. This is intended to give you the ability to orchestrate operation while also, signalling precise action(s) and flow with full read(ability).
    Since:
    1.0
    Author:
    Bobai Kato
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static <T> Que<T> of​(T value)
        This method will set value and returns instance of Que for other sequential Operations.
        Type Parameters:
        T - value Type
        Parameters:
        value - Que value
        Returns:
        Returns instance of Que
      • of

        public static <T> Que<T> of​(Supplier<? extends T> supplier)
        This method will take a Supplier of Type t and will set value and returns instance of Que for other sequential Operations.
        Type Parameters:
        T - Type of value
        Parameters:
        supplier - variable of Type value
        Returns:
        instance of Que
      • as

        public static <T> Que<T> as​(Dealer<? extends T> dealer)
                             throws Exception
        This method will take a Dealer of Type t and will set value and returns instance of Que for other sequential Operations.
        Type Parameters:
        T - Type of value
        Parameters:
        dealer - variable of Type value
        Returns:
        instance of Que
        Throws:
        Exception
      • run

        public static <T> Que<T> run​(Runnable runnable)
        This method will run a Runnable instance.
        Type Parameters:
        T - Type of value
        Parameters:
        runnable - Runnable type variable
        Returns:
        returns new instance of Que
        Since:
        1.0
      • run

        public Que<T> run​(Consumer<? super T> consumer)
        This method will consume execute Consumer type variable.
        Parameters:
        consumer - Consumer type variable.
        Returns:
        existing instance of the Que
        Since:
        1.0
      • execute

        public static <T> Que<T> execute​(Executable executable)
                                  throws Exception
        This method will run a Executable instance Use when Operation will throw an exception.
        Type Parameters:
        T - Type of value
        Parameters:
        executable - Runnable type variable
        Returns:
        returns new instance of Que
        Throws:
        Exception - this can be any exception throw when executing
        Since:
        1.0
      • execute

        public Que<T> execute​(Accepter<? super T> accepter)
                       throws Exception
        This method will Accept and execute Accepter type variable.
        Parameters:
        accepter - Accepter type variable.
        Returns:
        existing instance of the Que
        Throws:
        Exception
        Since:
        1.0
      • andRun

        public Que<T> andRun​(Runnable runnable)
        This method will execute a Runnable type variable.
        Parameters:
        runnable - Runnable type variable
        Returns:
        existing instance of Que
        Since:
        1.0
      • andExecute

        public Que<T> andExecute​(Executable executable)
                          throws Exception
        Use when Operation will throw an exception.
        Parameters:
        executable - Executable type variable
        Returns:
        existing instance of Que
        Throws:
        Exception - instance of any exception thrown.
        Since:
        1.0
      • andSupply

        public Que<T> andSupply​(Supplier<? extends T> supplier)
        This method will supply data value variable.
        Parameters:
        supplier - Supplier variable
        Returns:
        existing instance of Que
        Since:
        1.0
      • andDeal

        public Que<T> andDeal​(Dealer<? extends T> dealer)
                       throws Exception
        This method will deal data value variable. Use this method in place of Supplier if operation will throw an Exception.
        Parameters:
        dealer - Dealer variable
        Returns:
        existing instance of Que
        Throws:
        Exception
        Since:
        2.0
      • andConsume

        public Que<T> andConsume​(Consumer<? super T> consumer)
        This method will consume a Consumer type variable.
        Parameters:
        consumer - Consumer type variable
        Returns:
        existing instance of Que
        Since:
        1.0
      • andAccept

        public Que<T> andAccept​(Accepter<? super T> accepter)
                         throws Exception
        This method will accept na Accepter type variable. Use when operation will/may throw and Exception
        Parameters:
        accepter - Consumer type variable
        Returns:
        existing instance of Que
        Throws:
        Exception
        Since:
        1.0
      • andCall

        public Que<T> andCall​(Callable<? extends T> callable)
                       throws Exception
        This method will execute Callable type variable.
        Parameters:
        callable - Callable type variable.
        Returns:
        the result type of method call
        Throws:
        Exception - instance of any exception thrown.
        Since:
        1.0
      • get

        public T get()
        Used to get the current set value.
        Returns:
        value
        Since:
        1.0
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object