T - the instance object typepublic interface Instance<T>
| Modifier and Type | Method and Description |
|---|---|
default void |
command(Consumer<T> consumer)
Execute a function with the
getValue() as its parameters. |
default Class<? extends T> |
getContract()
The contract implemented by the instance.
|
default Type |
getGenericContract()
The generic contract implemented by the instance.If present the instance value can be
injected into services by this contract.
|
default String |
getName()
Get the name of instance.
|
T |
getValue()
Get the instance value.
|
default <R> R |
operation(Function<T,R> function)
Atomically execute the given function with the
getValue() as its parameters. |
default <R> R |
query(Function<T,R> function)
Execute the given function with the
getValue() as its parameters. |
T getValue()
default String getName()
default Class<? extends T> getContract()
default Type getGenericContract()
default <R> R query(Function<T,R> function)
getValue() as its parameters.R - function return typefunction - the functiondefault void command(Consumer<T> consumer)
getValue() as its parameters.consumer - the consumer functiondefault <R> R operation(Function<T,R> function)
getValue() as its parameters.R - function return typefunction - the functionCopyright © 2016–2018 Testify Project. All rights reserved.