public interface MapperContext
Modifier and Type | Method and Description |
---|---|
Map<Object,Object> |
getCustomState()
Retrieves any custom state that was set while building the mapper with
MapperBuilder.withCustomState(Object, Object) . |
DriverExecutionProfile |
getExecutionProfile()
If this context belongs to a DAO that was built with a method that takes an execution profile
as parameter, the value of that parameter.
|
String |
getExecutionProfileName()
If this context belongs to a DAO that was built with a method that takes an execution profile
name as parameter, the value of that parameter.
|
CqlIdentifier |
getKeyspaceId()
If this context belongs to a DAO that was built with a keyspace-parameterized mapper method,
the value of that parameter.
|
NameConverter |
getNameConverter(Class<? extends NameConverter> converterClass)
Returns an instance of the given converter class.
|
CqlSession |
getSession() |
CqlIdentifier |
getTableId()
If this context belongs to a DAO that was built with a table-parameterized mapper method, the
value of that parameter.
|
@NonNull CqlSession getSession()
@Nullable CqlIdentifier getKeyspaceId()
@Nullable CqlIdentifier getTableId()
@Nullable String getExecutionProfileName()
Note that this is mutually exclusive with getExecutionProfile()
: at most one of the
two methods returns a non-null value (or both return null if no profile was provided).
@Nullable DriverExecutionProfile getExecutionProfile()
Note that this is mutually exclusive with getExecutionProfileName()
: at most one of
the two methods returns a non-null value (or both return null if no profile was provided).
@NonNull NameConverter getNameConverter(Class<? extends NameConverter> converterClass)
The results of this method are cached at the mapper level. If no instance of this class exists yet for this mapper, a new instance is built by looking for a public no-arg constructor.
@NonNull Map<Object,Object> getCustomState()
MapperBuilder.withCustomState(Object, Object)
.
The returned map is immutable. If no state was set on the builder, it will be empty.
Copyright © 2017–2020. All rights reserved.