Top Description Fields Constructors Methods
org.springframework.r2dbc.core

pack-priv Class MapBindParameterSource

extends Object
implements BindParameterSource
Class Inheritance
All Implemented Interfaces
org.springframework.r2dbc.core.BindParameterSource
Imports
java.util.LinkedHashMap, .Map, io.r2dbc.spi.Parameter, .Parameters, org.springframework.util.Assert

BindParameterSource implementation that holds a given Map of parameters encapsulated as Parameter.

This class is intended for passing in a simple Map of parameter values to the methods of the NamedParameterExpander class.

Author
Mark Paluch
Since
5.3

Field Summary

Modifier and TypeField and Description
private final Map<String, Parameter>

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
MapBindParameterSource(Map<String, Parameter>
the parameter mapping
values
)

Creates a new MapBindParameterSource given Map of Parameter.

Method Summary

Modifier and TypeMethod and Description
pack-priv MapBindParameterSource
addValue(String
the name of the parameter
paramName
,
Object
the parameter value to add (must not be null)
value
)

Add a key-value pair to the MapBindParameterSource.

public Iterable<String>
getParameterNames()

Implements org.springframework.r2dbc.core.BindParameterSource.getParameterNames.

Return the parameter names of the underlying parameter source.

public Parameter
getValue(String
the name of the parameter
paramName
)

Implements org.springframework.r2dbc.core.BindParameterSource.getValue.

Return the parameter for the requested named parameter.

public boolean
hasValue(String
the name of the parameter
paramName
)

Implements org.springframework.r2dbc.core.BindParameterSource.hasValue.

Determine whether there is a value for the specified named parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

valuesback to summary
private final Map<String, Parameter> values

Constructor Detail

MapBindParameterSourceback to summary
pack-priv MapBindParameterSource()

Create a new empty MapBindParameterSource.

MapBindParameterSourceback to summary
pack-priv MapBindParameterSource(Map<String, Parameter> values)

Creates a new MapBindParameterSource given Map of Parameter.

Parameters
values:Map<String, Parameter>

the parameter mapping

Method Detail

addValueback to summary
pack-priv MapBindParameterSource addValue(String paramName, Object value)

Add a key-value pair to the MapBindParameterSource.

Parameters
paramName:String

the name of the parameter

value:Object

the parameter value to add (must not be null)

getParameterNamesback to summary
public Iterable<String> getParameterNames()

Implements org.springframework.r2dbc.core.BindParameterSource.getParameterNames.

Doc from org.springframework.r2dbc.core.BindParameterSource.getParameterNames.

Return the parameter names of the underlying parameter source.

Returns:Iterable<String>

an iterator over the parameter names

Annotations
@Override
getValueback to summary
public Parameter getValue(String paramName) throws IllegalArgumentException

Implements org.springframework.r2dbc.core.BindParameterSource.getValue.

Doc from org.springframework.r2dbc.core.BindParameterSource.getValue.

Return the parameter for the requested named parameter.

Parameters
paramName:String

the name of the parameter

Returns:Parameter

the specified parameter

Annotations
@Override
Exceptions
IllegalArgumentException:
if there is no value for the requested parameter
hasValueback to summary
public boolean hasValue(String paramName)

Implements org.springframework.r2dbc.core.BindParameterSource.hasValue.

Doc from org.springframework.r2dbc.core.BindParameterSource.hasValue.

Determine whether there is a value for the specified named parameter.

Parameters
paramName:String

the name of the parameter

Returns:boolean

true if there is a value defined; false otherwise

Annotations
@Override