Package art.cutils.value
Class Que<T>
- java.lang.Object
-
- art.cutils.value.Que<T>
-
- Type Parameters:
T
- type.
- All Implemented Interfaces:
Serializable
public final class Que<T> extends Object implements Serializable
This isQue
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Que<T>
andAccept(Accepter<? super T> accepter)
This method will accept naAccepter
type variable.@NotNull Que<T>
andCall(Callable<? extends T> callable)
This method will executeCallable
type variable.Que<T>
andConsume(Consumer<? super T> consumer)
This method will consume aConsumer
type variable.@NotNull Que<T>
andDeal(Dealer<? extends T> dealer)
This method will deal datavalue
variable.Que<T>
andExecute(Executable executable)
Use when Operation will throw an exception.Que<T>
andRun(Runnable runnable)
This method will execute aRunnable
type variable.@NotNull Que<T>
andSupply(Supplier<? extends T> supplier)
This method will supply datavalue
variable.static <T> @NotNull Que<T>
as(Dealer<? extends T> dealer)
@NotNull CompletableFuture<T>
completableFuture()
Used to get current value ofCompletableFuture
type.boolean
equals(Object o)
Que<T>
execute(Accepter<? super T> accepter)
This method will Accept and executeAccepter
type variable.static <T> @NotNull Que<T>
execute(Executable executable)
This method will run aExecutable
instance Use when Operation will throw an exception.T
get()
Used to get the current set value.int
hashCode()
<R> @NotNull Que<R>
map(Function<? super T,? extends R> mapper)
static <T> @NotNull Que<T>
of(@NotNull Supplier<? extends T> supplier)
static <T> @NotNull Que<T>
of(T value)
This method will setvalue
and returns instance ofQue
for other sequential Operations.Optional<T>
optional()
Used to get current value ofOptional
type.static <T> @NotNull Que<T>
run(Runnable runnable)
This method will run aRunnable
instance.Que<T>
run(Consumer<? super T> consumer)
This method will consume executeConsumer
type variable.
-
-
-
Method Detail
-
of
@Contract("_ -> new") @NotNull public static <T> @NotNull Que<T> of(@NotNull @NotNull Supplier<? extends T> supplier)
This method will take aSupplier
of Type t and will setvalue
and returns instance ofQue
for other sequential Operations.- Type Parameters:
T
- Type of value- Parameters:
supplier
- variable of Type value- Returns:
- instance of
Que
-
run
@NotNull public static <T> @NotNull Que<T> run(Runnable runnable)
This method will run aRunnable
instance.
-
execute
@NotNull public static <T> @NotNull Que<T> execute(Executable executable) throws Exception
This method will run aExecutable
instance Use when Operation will throw an exception.
-
map
@NotNull public <R> @NotNull Que<R> map(Function<? super T,? extends R> mapper)
- Parameters:
mapper
- a mapping function to apply to the result is available.- Returns:
- Returns instance of
Que
-
of
@Contract(value="_ -> new", pure=true) @NotNull public static <T> @NotNull Que<T> of(T value)
This method will setvalue
and returns instance ofQue
for other sequential Operations.
-
run
@Contract("_ -> this") public Que<T> run(Consumer<? super T> consumer)
This method will consume executeConsumer
type variable.
-
execute
@Contract("_ -> this") public Que<T> execute(Accepter<? super T> accepter) throws Exception
This method will Accept and executeAccepter
type variable.
-
andRun
@Contract("_ -> this") public Que<T> andRun(Runnable runnable)
This method will execute aRunnable
type variable.
-
andExecute
@Contract("_ -> this") 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
@Contract("_ -> this") @NotNull public @NotNull Que<T> andSupply(Supplier<? extends T> supplier)
This method will supply datavalue
variable.
-
andDeal
@Contract("_ -> this") @NotNull public @NotNull Que<T> andDeal(Dealer<? extends T> dealer) throws Exception
-
andConsume
@Contract("_ -> this") public Que<T> andConsume(Consumer<? super T> consumer)
This method will consume aConsumer
type variable.
-
andAccept
@Contract("_ -> this") public Que<T> andAccept(Accepter<? super T> accepter) throws Exception
-
andCall
@NotNull public @NotNull Que<T> andCall(Callable<? extends T> callable) throws Exception
This method will executeCallable
type variable.
-
get
@Contract(pure=true) public T get()
Used to get the current set value.- Returns:
value
- Since:
- 1.0
-
completableFuture
@NotNull public @NotNull CompletableFuture<T> completableFuture()
Used to get current value ofCompletableFuture
type.- Returns:
CompletableFuture
ofvalue
- Since:
- 1.0
-
optional
@Contract(pure=true) public Optional<T> optional()
Used to get current value ofOptional
type.
-
-