Class Bindable<T>
java.lang.Object
org.springframework.boot.context.properties.bind.Bindable<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Restrictions that can be applied when binding values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
<A extends Annotation>
AgetAnnotation
(Class<A> type) Return a single associated annotations that could affect binding.Return any associated annotations that could affect binding.Returns themethod
to be used to bind this bindable, ornull
if no specific binding method is required.Return the boxed type of the item to bind.getType()
Return the type of the item to bind.getValue()
Return a supplier that provides the object value ornull
.boolean
hasBindRestriction
(Bindable.BindRestriction bindRestriction) Returnstrue
if the specified bind restriction has been added.int
hashCode()
static <T> Bindable
<T> Create a newBindable
of the specified type.static <T> Bindable
<T> of
(ResolvableType type) Create a newBindable
of the specified type.static <T> Bindable
<T> ofInstance
(T instance) Create a newBindable
of the type of the specified instance with an existing value equal to the instance.toString()
withAnnotations
(Annotation... annotations) Create an updatedBindable
instance with the specified annotations.withBindMethod
(BindMethod bindMethod) Create an updatedBindable
instance with a specific bind method.withBindRestrictions
(Bindable.BindRestriction... additionalRestrictions) Create an updatedBindable
instance with additional bind restrictions.withExistingValue
(T existingValue) Create an updatedBindable
instance with an existing value.withSuppliedValue
(Supplier<T> suppliedValue) Create an updatedBindable
instance with a value supplier.
-
Method Details
-
getType
-
getBoxedType
Return the boxed type of the item to bind.- Returns:
- the boxed type for the item being bound
-
getValue
-
getAnnotations
Return any associated annotations that could affect binding.- Returns:
- the associated annotations
-
getAnnotation
Return a single associated annotations that could affect binding.- Type Parameters:
A
- the annotation type- Parameters:
type
- annotation type- Returns:
- the associated annotation or
null
-
hasBindRestriction
Returnstrue
if the specified bind restriction has been added.- Parameters:
bindRestriction
- the bind restriction to check- Returns:
- if the bind restriction has been added
- Since:
- 2.5.0
-
getBindMethod
Returns themethod
to be used to bind this bindable, ornull
if no specific binding method is required.- Returns:
- the bind method or
null
- Since:
- 3.0.8
-
equals
-
hashCode
-
toString
-
withAnnotations
-
withExistingValue
-
withSuppliedValue
-
withBindRestrictions
-
withBindMethod
Create an updatedBindable
instance with a specific bind method. To usevalue object binding
, the current instance must not have an existing or supplied value.- Parameters:
bindMethod
- the method to use to bind the bindable- Returns:
- an updated
Bindable
- Since:
- 3.0.8
-
ofInstance
-
of
-
listOf
-
setOf
-
mapOf
-
of
-