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

public Class Bindings

extends Object
implements Iterable<Bindings.Binding>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Known Direct Subclasses
org.springframework.r2dbc.core.binding.MutableBindings
Imports
java.util.ArrayList, .Collection, .Collections, .Iterator, .List, .Map, .Spliterator, java.util.function.Consumer, io.r2dbc.spi.Statement, org.springframework.lang.NonNull, .Nullable, org.springframework.util.Assert, .CollectionUtils

Value object representing value and null bindings for a Statement using BindMarkers. Bindings are typically immutable.
Author
Mark Paluch
Since
5.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
Bindings.Binding

Base class for value objects representing a value or a NULL binding.

pack-priv static class
Bindings.NullBinding

NULL binding.

pack-priv static class
Bindings.ValueBinding

Value binding.

Field Summary

Modifier and TypeField and Description
private final Map<BindMarker, Bindings.Binding>
private static final Bindings

Constructor Summary

AccessConstructor and Description
public
Bindings()

Create empty Bindings.

public
Bindings(Collection<Bindings.Binding>
a collection of Binding objects
bindings
)

Create Bindings from the given collection.

pack-priv

Method Summary

Modifier and TypeMethod and Description
public Bindings

Returns:

a newly merged Bindings object
and
(Bindings
the object to merge with
other
)

Merge this bindings with an other Bindings object and create a new merged Bindings object.

public void
apply(BindTarget
the target to apply bindings to
bindTarget
)

Apply the bindings to a BindTarget.

public static Bindings
empty()

Return an empty Bindings object.

public void
forEach(Consumer<? super Bindings.Binding>
the action to be performed for each Binding
action
)

Overrides default java.lang.Iterable.forEach.

Perform the given action for each binding of this Bindings until all bindings have been processed or the action throws an exception.

protected Map<BindMarker, Bindings.Binding>
public Iterator<Bindings.Binding>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public static Bindings

Returns:

a newly merged Bindings object
merge
(Bindings
the left object to merge with
left
,
Bindings
the right object to merge with
right
)

Merge this bindings with an other Bindings object and create a new merged Bindings object.

public Spliterator<Bindings.Binding>
spliterator()

Overrides default java.lang.Iterable.spliterator.

Creates a Spliterator over the elements described by this Iterable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bindingsback to summary
private final Map<BindMarker, Bindings.Binding> bindings
EMPTYback to summary
private static final Bindings EMPTY

Constructor Detail

Bindingsback to summary
public Bindings()

Create empty Bindings.

Bindingsback to summary
public Bindings(Collection<Bindings.Binding> bindings)

Create Bindings from the given collection.

Parameters
bindings:Collection<Bindings.Binding>

a collection of Binding objects

Bindingsback to summary
pack-priv Bindings(Map<BindMarker, Bindings.Binding> bindings)

Method Detail

andback to summary
public Bindings and(Bindings other)

Merge this bindings with an other Bindings object and create a new merged Bindings object.

Parameters
other:Bindings

the object to merge with

Returns:Bindings

a newly merged Bindings object

applyback to summary
public void apply(BindTarget bindTarget)

Apply the bindings to a BindTarget.

Parameters
bindTarget:BindTarget

the target to apply bindings to

emptyback to summary
public static Bindings empty()

Return an empty Bindings object.

forEachback to summary
public void forEach(Consumer<? super Bindings.Binding> action)

Overrides default java.lang.Iterable.forEach.

Perform the given action for each binding of this Bindings until all bindings have been processed or the action throws an exception. Actions are performed in the order of iteration (if an iteration order is specified). Exceptions thrown by the action are relayed to the

Parameters
action:Consumer<? super Bindings.Binding>

the action to be performed for each Binding

Annotations
@Override
getBindingsback to summary
protected Map<BindMarker, Bindings.Binding> getBindings()
iteratorback to summary
public Iterator<Bindings.Binding> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<Bindings.Binding>

an Iterator.

Annotations
@Override
mergeback to summary
public static Bindings merge(Bindings left, Bindings right)

Merge this bindings with an other Bindings object and create a new merged Bindings object.

Parameters
left:Bindings

the left object to merge with

right:Bindings

the right object to merge with

Returns:Bindings

a newly merged Bindings object

spliteratorback to summary
public Spliterator<Bindings.Binding> spliterator()

Overrides default java.lang.Iterable.spliterator.

Doc from java.lang.Iterable.spliterator.

Creates a Spliterator over the elements described by this Iterable.

Returns:Spliterator<Bindings.Binding>

a Spliterator over the elements described by this Iterable.

Annotations
@Override
org.springframework.r2dbc.core.binding back to summary

public abstract Class Bindings.Binding

extends Object
Class Inheritance
Known Direct Subclasses
org.springframework.r2dbc.core.binding.Bindings.ValueBinding, org.springframework.r2dbc.core.binding.Bindings.NullBinding

Base class for value objects representing a value or a NULL binding.

Field Summary

Modifier and TypeField and Description
private final BindMarker

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract void
apply(BindTarget
the target to apply bindings to
bindTarget
)

Apply the binding to a BindTarget.

public BindMarker
getBindMarker()

Return the associated BindMarker.

public abstract Object

Returns:

the value of this binding (can be null if this is a NULL binding)
getValue
()

Return the binding value.

public abstract boolean

Returns:

true if there is a value present, otherwise false for a NULL binding
hasValue
()

Return whether the binding has a value associated with it.

public boolean

Returns:

true if this is a NULL binding
isNull
()

Return whether the binding is empty.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

markerback to summary
private final BindMarker marker

Constructor Detail

Bindingback to summary
protected Binding(BindMarker marker)

Method Detail

applyback to summary
public abstract void apply(BindTarget bindTarget)

Apply the binding to a BindTarget.

Parameters
bindTarget:BindTarget

the target to apply bindings to

getBindMarkerback to summary
public BindMarker getBindMarker()

Return the associated BindMarker.

getValueback to summary
public abstract Object getValue()

Return the binding value.

Returns:Object

the value of this binding (can be null if this is a NULL binding)

Annotations
@Nullable
hasValueback to summary
public abstract boolean hasValue()

Return whether the binding has a value associated with it.

Returns:boolean

true if there is a value present, otherwise false for a NULL binding

isNullback to summary
public boolean isNull()

Return whether the binding is empty.

Returns:boolean

true if this is a NULL binding

org.springframework.r2dbc.core.binding back to summary

pack-priv Class Bindings.NullBinding

extends Binding
Class Inheritance

NULL binding.

Field Summary

Modifier and TypeField and Description
private final Class<?>

Constructor Summary

AccessConstructor and Description
pack-priv
NullBinding(BindMarker marker, Class<?> valueType)

Method Summary

Modifier and TypeMethod and Description
public void
apply(BindTarget
the target to apply bindings to
bindTarget
)

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.apply.

Apply the binding to a BindTarget.

public Object
getValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.getValue.

Return the binding value.

public Class<?>
public boolean
hasValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.hasValue.

Return whether the binding has a value associated with it.

Inherited from org.springframework.r2dbc.core.binding.Bindings.Binding:
getBindMarkerisNull

Field Detail

valueTypeback to summary
private final Class<?> valueType

Constructor Detail

NullBindingback to summary
pack-priv NullBinding(BindMarker marker, Class<?> valueType)

Method Detail

applyback to summary
public void apply(BindTarget bindTarget)

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.apply.

Doc from org.springframework.r2dbc.core.binding.Bindings.Binding.apply.

Apply the binding to a BindTarget.

Parameters
bindTarget:BindTarget

the target to apply bindings to

Annotations
@Override
getValueback to summary
public Object getValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.getValue.

Doc from org.springframework.r2dbc.core.binding.Bindings.Binding.getValue.

Return the binding value.

Returns:Object

the value of this binding (can be null if this is a NULL binding)

Annotations
@Override
@Nullable
getValueTypeback to summary
public Class<?> getValueType()
hasValueback to summary
public boolean hasValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.hasValue.

Doc from org.springframework.r2dbc.core.binding.Bindings.Binding.hasValue.

Return whether the binding has a value associated with it.

Returns:boolean

true if there is a value present, otherwise false for a NULL binding

Annotations
@Override
org.springframework.r2dbc.core.binding back to summary

pack-priv Class Bindings.ValueBinding

extends Binding
Class Inheritance

Value binding.

Field Summary

Modifier and TypeField and Description
private final Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
apply(BindTarget
the target to apply bindings to
bindTarget
)

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.apply.

Apply the binding to a BindTarget.

public Object
getValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.getValue.

Return the binding value.

public boolean
hasValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.hasValue.

Return whether the binding has a value associated with it.

Inherited from org.springframework.r2dbc.core.binding.Bindings.Binding:
getBindMarkerisNull

Field Detail

valueback to summary
private final Object value

Constructor Detail

ValueBindingback to summary
pack-priv ValueBinding(BindMarker marker, Object value)

Method Detail

applyback to summary
public void apply(BindTarget bindTarget)

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.apply.

Doc from org.springframework.r2dbc.core.binding.Bindings.Binding.apply.

Apply the binding to a BindTarget.

Parameters
bindTarget:BindTarget

the target to apply bindings to

Annotations
@Override
getValueback to summary
public Object getValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.getValue.

Doc from org.springframework.r2dbc.core.binding.Bindings.Binding.getValue.

Return the binding value.

Returns:Object

the value of this binding (can be null if this is a NULL binding)

Annotations
@Override
@NonNull
hasValueback to summary
public boolean hasValue()

Implements abstract org.springframework.r2dbc.core.binding.Bindings.Binding.hasValue.

Doc from org.springframework.r2dbc.core.binding.Bindings.Binding.hasValue.

Return whether the binding has a value associated with it.

Returns:boolean

true if there is a value present, otherwise false for a NULL binding

Annotations
@Override