Package io.ryos.rhino.sdk.dsl.impl
Class LoadDslImpl
- java.lang.Object
-
- io.ryos.rhino.sdk.dsl.impl.AbstractDSLItem
-
- io.ryos.rhino.sdk.dsl.impl.LoadDslImpl
-
- All Implemented Interfaces:
AssertionDsl
,DslItem
,IterableDsl
,LoadDsl
,MappableDsl
,MaterializableDsl
,MaterializableDslItem
,MeasureDsl
,SessionDsl
public class LoadDslImpl extends AbstractDSLItem implements LoadDsl
Load DSL implementation, that is the container DSL instance to bind other DSL items.- Author:
- Erhan Bagdemir
-
-
Field Summary
-
Fields inherited from interface io.ryos.rhino.sdk.dsl.LoadDsl
dslMethodName
-
-
Constructor Summary
Constructors Constructor Description LoadDslImpl(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoadDsl
asLongAs(java.util.function.Predicate<UserSession> predicate, MaterializableDslItem dslItem)
Runs theMaterializableDslItem
as long as thePredicate
holds.LoadDsl
ensure(java.util.function.Predicate<UserSession> predicate)
Ensure DSL is to assert the predicate passed holds true, otherwise it stops the pipeline.LoadDsl
ensure(java.util.function.Predicate<UserSession> predicate, java.lang.String reason)
Ensure DSL is to assert the predicate passed holds true, otherwise it stops the pipeline.LoadDsl
filter(java.util.function.Predicate<UserSession> predicate)
Filter is used to filter according to the predicate.<E,R extends java.lang.Iterable<E>>
LoadDslforEach(ForEachBuilder<E,R> forEachBuilder)
For-each DSL spec loops through the sequence of elements built byForEachBuilder
instance.<E,R extends java.lang.Iterable<E>>
LoadDslforEach(java.lang.String name, ForEachBuilder<E,R> forEachBuilder)
For-each DSL spec loops through the sequence of elements built byForEachBuilder
instance.java.util.List<MaterializableDslItem>
getChildren()
<R,T>
LoadDslmap(MapperBuilder<R,T> mapperBuilder)
LoadDslMaterializer
materializer()
Create materializer instance for this spec instance.LoadDsl
measure(java.lang.String tag, MaterializableDslItem dslItem)
LoadDsl
repeat(MaterializableDslItem dslItem)
Runs theMaterializableDslItem
repeatedly.LoadDsl
run(MaterializableDslItem dslItem)
Runner DSL is aLoadDsl
instance to run theMaterializableDslItem
passed as parameter.LoadDsl
runIf(java.util.function.Predicate<UserSession> predicate, MaterializableDslItem dslItem)
Conditional runnable DSL is aLoadDsl
ifPredicate
returnstrue
, then the execution proceeds and it runs theMaterializableDslItem
passed as parameter.LoadDsl
session(java.lang.String sessionKey, java.lang.Object object)
Session DSL is used to save objects to the current session.LoadDsl
session(java.lang.String sessionKey, java.util.function.Supplier<java.lang.Object> objectSupplier)
Session DSL is used to save objects to the current session which are provided by the object supplier.LoadDsl
until(java.util.function.Predicate<UserSession> predicate, MaterializableDslItem dslItem)
Runs theMaterializableDslItem
till thePredicate
holds.LoadDsl
wait(java.time.Duration duration)
Wait DSL is a DSL instance which makes execution halt forDuration
.LoadDsl
withName(java.lang.String dslName)
-
Methods inherited from class io.ryos.rhino.sdk.dsl.impl.AbstractDSLItem
getName, getParent, getParentName, hasParent, setName, setParent
-
-
-
-
Method Detail
-
wait
public LoadDsl wait(java.time.Duration duration)
Description copied from interface:LoadDsl
Wait DSL is a DSL instance which makes execution halt forDuration
.- Specified by:
wait
in interfaceLoadDsl
- Parameters:
duration
-Duration
to wait.- Returns:
LoadDslImpl
instance.
-
run
public LoadDsl run(MaterializableDslItem dslItem)
Description copied from interface:LoadDsl
Runner DSL is aLoadDsl
instance to run theMaterializableDslItem
passed as parameter.- Specified by:
run
in interfaceLoadDsl
- Parameters:
dslItem
-MaterializableDslItem
to materialize and run.- Returns:
LoadDslImpl
instance.
-
ensure
public LoadDsl ensure(java.util.function.Predicate<UserSession> predicate)
Description copied from interface:AssertionDsl
Ensure DSL is to assert the predicate passed holds true, otherwise it stops the pipeline.- Specified by:
ensure
in interfaceAssertionDsl
- Returns:
LoadDslImpl
instance.
-
ensure
public LoadDsl ensure(java.util.function.Predicate<UserSession> predicate, java.lang.String reason)
Description copied from interface:AssertionDsl
Ensure DSL is to assert the predicate passed holds true, otherwise it stops the pipeline.- Specified by:
ensure
in interfaceAssertionDsl
- Returns:
LoadDslImpl
instance.
-
session
public LoadDsl session(java.lang.String sessionKey, java.util.function.Supplier<java.lang.Object> objectSupplier)
Description copied from interface:SessionDsl
Session DSL is used to save objects to the current session which are provided by the object supplier.- Specified by:
session
in interfaceSessionDsl
- Parameters:
sessionKey
- Session key.objectSupplier
- Object provider.- Returns:
- Runnable DSL instance.
-
session
public LoadDsl session(java.lang.String sessionKey, java.lang.Object object)
Description copied from interface:SessionDsl
Session DSL is used to save objects to the current session.- Specified by:
session
in interfaceSessionDsl
object
- Object instance to store in the session.- Returns:
LoadDsl
instance.
-
map
public <R,T> LoadDsl map(MapperBuilder<R,T> mapperBuilder)
- Specified by:
map
in interfaceMappableDsl
-
forEach
public <E,R extends java.lang.Iterable<E>> LoadDsl forEach(java.lang.String name, ForEachBuilder<E,R> forEachBuilder)
Description copied from interface:IterableDsl
For-each DSL spec loops through the sequence of elements built byForEachBuilder
instance.- Specified by:
forEach
in interfaceIterableDsl
- Parameters:
name
- Name of the runner DSL.forEachBuilder
- Iterable builder.- Returns:
LoadDsl
runnable DSL instance.
-
forEach
public <E,R extends java.lang.Iterable<E>> LoadDsl forEach(ForEachBuilder<E,R> forEachBuilder)
Description copied from interface:IterableDsl
For-each DSL spec loops through the sequence of elements built byForEachBuilder
instance.- Specified by:
forEach
in interfaceIterableDsl
- Parameters:
forEachBuilder
- Iterable builder.- Returns:
LoadDsl
runnable DSL instance.
-
repeat
public LoadDsl repeat(MaterializableDslItem dslItem)
Description copied from interface:IterableDsl
Runs theMaterializableDslItem
repeatedly.- Specified by:
repeat
in interfaceIterableDsl
- Parameters:
dslItem
-MaterializableDslItem
to run.- Returns:
LoadDsl
runnable DSL instance.
-
until
public LoadDsl until(java.util.function.Predicate<UserSession> predicate, MaterializableDslItem dslItem)
Description copied from interface:IterableDsl
Runs theMaterializableDslItem
till thePredicate
holds.- Specified by:
until
in interfaceIterableDsl
- Parameters:
predicate
- Run conditional.dslItem
-MaterializableDslItem
to run.- Returns:
LoadDsl
runnable DSL instance.
-
asLongAs
public LoadDsl asLongAs(java.util.function.Predicate<UserSession> predicate, MaterializableDslItem dslItem)
Description copied from interface:IterableDsl
Runs theMaterializableDslItem
as long as thePredicate
holds.- Specified by:
asLongAs
in interfaceIterableDsl
- Parameters:
predicate
- Run conditional.dslItem
-MaterializableDslItem
to run.- Returns:
LoadDsl
runnable DSL instance.
-
runIf
public LoadDsl runIf(java.util.function.Predicate<UserSession> predicate, MaterializableDslItem dslItem)
Description copied from interface:LoadDsl
Conditional runnable DSL is aLoadDsl
ifPredicate
returnstrue
, then the execution proceeds and it runs theMaterializableDslItem
passed as parameter.- Specified by:
runIf
in interfaceLoadDsl
- Parameters:
predicate
-Predicate
which is conditional for execution ofMaterializableDslItem
provided.dslItem
-MaterializableDslItem
to materialize and run.- Returns:
LoadDslImpl
instance.
-
measure
public LoadDsl measure(java.lang.String tag, MaterializableDslItem dslItem)
- Specified by:
measure
in interfaceMeasureDsl
-
filter
public LoadDsl filter(java.util.function.Predicate<UserSession> predicate)
Description copied from interface:LoadDsl
Filter is used to filter according to the predicate.- Specified by:
filter
in interfaceLoadDsl
- Parameters:
predicate
- Predicate instance applied in filter.- Returns:
LoadDslImpl
instance.
-
withName
public LoadDsl withName(java.lang.String dslName)
-
getChildren
public java.util.List<MaterializableDslItem> getChildren()
- Specified by:
getChildren
in interfaceDslItem
-
materializer
public LoadDslMaterializer materializer()
Description copied from interface:MaterializableDsl
Create materializer instance for this spec instance.- Specified by:
materializer
in interfaceMaterializableDsl
- Returns:
DslMaterializer
instance.
-
-