Interface BindConstructorProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface used to determine a specific constructor to use when binding.
- Since:
- 2.2.1
-
Field Summary
Modifier and TypeFieldDescriptionstatic final BindConstructorProvider
DefaultBindConstructorProvider
implementation that only returns a value when there's a single constructor and when the bindable has no existing value. -
Method Summary
Modifier and TypeMethodDescriptiondefault Constructor<?>
getBindConstructor
(Class<?> type, boolean isNestedConstructorBinding) Return the bind constructor to use for the given type, ornull
if constructor binding is not supported.Constructor<?>
getBindConstructor
(Bindable<?> bindable, boolean isNestedConstructorBinding) Return the bind constructor to use for the given bindable, ornull
if constructor binding is not supported.
-
Field Details
-
DEFAULT
DefaultBindConstructorProvider
implementation that only returns a value when there's a single constructor and when the bindable has no existing value.
-
-
Method Details
-
getBindConstructor
Return the bind constructor to use for the given type, ornull
if constructor binding is not supported.- Parameters:
type
- the type to checkisNestedConstructorBinding
- if this binding is nested within a constructor binding- Returns:
- the bind constructor or
null
- Since:
- 3.0.0
-
getBindConstructor
Return the bind constructor to use for the given bindable, ornull
if constructor binding is not supported.- Parameters:
bindable
- the bindable to checkisNestedConstructorBinding
- if this binding is nested within a constructor binding- Returns:
- the bind constructor or
null
-