public class RowMappers extends Object implements JdbiConfig<RowMappers>
RowMapperFactory instances.| Constructor and Description |
|---|
RowMappers() |
| Modifier and Type | Method and Description |
|---|---|
RowMappers |
createCopy()
Returns a copy of this configuration object.
|
<T> Optional<RowMapper<T>> |
findFor(Class<T> type)
Obtain a row mapper for the given type in the given context.
|
<T> Optional<RowMapper<T>> |
findFor(GenericType<T> type)
Obtain a row mapper for the given type in the given context.
|
Optional<RowMapper<?>> |
findFor(Type type)
Obtain a row mapper for the given type in the given context.
|
<T> RowMappers |
register(GenericType<T> type,
RowMapper<T> mapper)
Register a row mapper for a given type.
|
RowMappers |
register(RowMapper<?> mapper)
Register a row mapper which will have its parameterized type inspected to determine what it maps to.
|
RowMappers |
register(RowMapperFactory factory)
Register a row mapper factory.
|
RowMappers |
register(Type type,
RowMapper<?> mapper)
Register a row mapper for a given type.
|
void |
setRegistry(ConfigRegistry registry)
The registry will inject itself into the configuration object.
|
public RowMappers createCopy()
JdbiConfigcreateCopy in interface JdbiConfig<RowMappers>public <T> Optional<RowMapper<T>> findFor(Class<T> type)
T - the type of the mapper to findtype - the target type to map topublic <T> Optional<RowMapper<T>> findFor(GenericType<T> type)
T - the type of the mapper to findtype - the target type to map topublic Optional<RowMapper<?>> findFor(Type type)
type - the target type to map topublic <T> RowMappers register(GenericType<T> type, RowMapper<T> mapper)
T - the typetype - the type to match with equals.mapper - the row mapperpublic RowMappers register(RowMapper<?> mapper)
ResultBearing.mapTo(Class) for registered mappings.
The parameter must be concretely parameterized, we use the type argument T to determine if it applies to a given type.
mapper - the row mapperUnsupportedOperationException - if the RowMapper is not a concretely parameterized typepublic RowMappers register(RowMapperFactory factory)
Will be used with ResultBearing.mapTo(Class) for registered mappings.
factory - the row mapper factorypublic RowMappers register(Type type, RowMapper<?> mapper)
type - the type to match with equals.mapper - the row mapperpublic void setRegistry(ConfigRegistry registry)
JdbiConfigsetRegistry in interface JdbiConfig<RowMappers>registry - the registry that owns this configuration objectCopyright © 2019. All rights reserved.