Class MapperBuilder<R,T>
- java.lang.Object
-
- io.ryos.rhino.sdk.dsl.data.builder.MapperBuilder<R,T>
-
public class MapperBuilder<R,T> extends java.lang.Object
Helper builder used with map() DSL. UseMapperBuilder
instances to complete theMappableDsl.map(MapperBuilder)
DSL.- Author:
- Erhan Bagdemir
- See Also:
MappableDsl.map(MapperBuilder)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MapperBuilder<R,T>
collect(java.lang.String sessionKey)
After map function is applied, use this method to store the output object in the define.MapperBuilder<R,T>
collect(java.lang.String sessionKey, SessionDslItem.Scope sessionScope)
After map function is applied, use this method to store the output object in the define.MapperBuilder<R,T>
doMap(java.util.function.Function<R,T> mappingFunction)
Use to provide aFunction
instance which will be applied to the input object and returns the target object.java.lang.String
getKey()
java.util.function.Function<R,T>
getMappingFunction()
java.lang.String
getSaveTo()
java.util.function.Function<UserSession,T>
getSessionExtractor()
SessionDslItem.Scope
getSessionScope()
static <R,T>
MapperBuilder<R,T>in(java.lang.String sessionKey)
Use the method to access the define object with the key, sessionKey.static <R,T>
MapperBuilder<R,T>in(java.util.function.Function<UserSession,T> sessionExtractor)
-
-
-
Method Detail
-
in
public static <R,T> MapperBuilder<R,T> in(java.lang.String sessionKey)
Use the method to access the define object with the key, sessionKey.- Type Parameters:
R
- The type of the define object.T
- Target type to which the define object will be mapped.- Parameters:
sessionKey
- The define key of the object being accessed.- Returns:
MapperBuilder
instance.
-
in
public static <R,T> MapperBuilder<R,T> in(java.util.function.Function<UserSession,T> sessionExtractor)
-
doMap
public MapperBuilder<R,T> doMap(java.util.function.Function<R,T> mappingFunction)
Use to provide aFunction
instance which will be applied to the input object and returns the target object.- Parameters:
mappingFunction
- The function which is used to map the input object to the output.- Returns:
MapperBuilder
instance.
-
collect
public MapperBuilder<R,T> collect(java.lang.String sessionKey)
After map function is applied, use this method to store the output object in the define.- Parameters:
sessionKey
- Session key for the output instance.- Returns:
MapperBuilder
instance.
-
collect
public MapperBuilder<R,T> collect(java.lang.String sessionKey, SessionDslItem.Scope sessionScope)
After map function is applied, use this method to store the output object in the define.- Parameters:
sessionKey
- Session key for the output instance.sessionScope
- Session scope.- Returns:
MapperBuilder
instance.
-
getKey
public java.lang.String getKey()
-
getSaveTo
public java.lang.String getSaveTo()
-
getSessionScope
public SessionDslItem.Scope getSessionScope()
-
getSessionExtractor
public java.util.function.Function<UserSession,T> getSessionExtractor()
-
-