Top Description Methods
io.r2dbc.spi

public Interface Readable

Known Direct Subinterfaces
io.r2dbc.spi.Row, io.r2dbc.spi.OutParameters
Imports
java.util.NoSuchElementException

Represents a readable object, for example a set of columns or OUT parameters from a database query, later on referred to as items. Values can for columns or OUT parameters be either retrieved by specifying a name or the index. Indexes are 0-based.

Column and OUT parameter names used as input to getter methods are case-insensitive. When a get method is called with a name and several items have the same name, then the value of the first matching item will be returned. Items that are not explicitly named in the query should be referenced through indexes.

For maximum portability, items within each Readable should be read in left-to-right order, and each item should be read only once.

get(String) and get(int) without specifying a target type returns a suitable value representation. The R2DBC specification contains a mapping table that shows default mappings between database types and Java types. Specifying a target type, the R2DBC driver attempts to convert the value to the target type.

A item is invalidated after consumption.

Since
0.9
See Also
Row, OutParameters

Method Summary

Modifier and TypeMethod and Description
public default Object

Returns:

the value. Value can be null.
get
(int
the index of the parameter starting at 0
index
)

Returns the value using the default type mapping.

public <
the type of the item being returned.
T
>
T

Returns:

the value. Value can be null.
get
(int
the index starting at 0
index
,
Class<T>
the type of item to return. This type must be assignable to, and allows for variance.
type
)

Returns the value for a parameter.

public default Object

Returns:

the value. Value can be null.
get
(String
the name
name
)

Returns the value for a parameter using the default type mapping.

public <
the type of the item being returned.
T
>
T

Returns:

the value. Value can be null.
get
(String
the name
name
,
Class<T>
the type of item to return. This type must be assignable to, and allows for variance.
type
)

Returns the value.

Method Detail

getback to summary
public default Object get(int index)

Returns the value using the default type mapping. The default implementation of this method calls get(int, Class) passing Object as the type to allow the implementation to make the loosest possible match.

Parameters
index:int

the index of the parameter starting at 0

Returns:Object

the value. Value can be null.

Annotations
@Nullable
Exceptions
IndexOutOfBoundsException:
if index if the index is out of range (negative or equals/exceeds the number of readable objects)
getback to summary
public <T> T get(int index, Class<T> type)

Returns the value for a parameter. Use Object to allow the implementation to make the loosest possible match.

Parameters
<T>
the type of the item being returned.
index:int

the index starting at 0

type:Class<T>

the type of item to return. This type must be assignable to, and allows for variance.

Returns:T

the value. Value can be null.

Annotations
@Nullable
Exceptions
IllegalArgumentException:
if type is null
IndexOutOfBoundsException:
if index is out of range (negative or equals/exceeds the number of readable objects)
getback to summary
public default Object get(String name)

Returns the value for a parameter using the default type mapping. The default implementation of this method calls get(String, Class) passing Object as the type in order to allow the implementation to make the loosest possible match.

Parameters
name:String

the name

Returns:Object

the value. Value can be null.

Annotations
@Nullable
Exceptions
IllegalArgumentException:
if name is null
NoSuchElementException:
if name is not a known readable column or out parameter
getback to summary
public <T> T get(String name, Class<T> type)

Returns the value. Use Object to allow the implementation to make the loosest possible match.

Parameters
<T>
the type of the item being returned.
name:String

the name

type:Class<T>

the type of item to return. This type must be assignable to, and allows for variance.

Returns:T

the value. Value can be null.

Annotations
@Nullable
Exceptions
IllegalArgumentException:
if name or type is null
NoSuchElementException:
if name is not a known readable column or out parameter