类 Bindable<T>
java.lang.Object
cn.taketoday.context.properties.bind.Bindable<T>
- 类型参数:
T- the source type
Source that can be bound by a
Binder.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Madhura Bhave, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static enumRestrictions that can be applied when binding values. -
方法概要
修饰符和类型方法说明boolean<A extends Annotation>
AgetAnnotation(Class<A> type) Return a single associated annotations that could affect binding.Return any associated annotations that could affect binding.cn.taketoday.core.ResolvableTypeReturn the boxed type of the item to bind.cn.taketoday.core.ResolvableTypegetType()Return the type of the item to bind.getValue()Return a supplier that provides the object value ornull.booleanhasBindRestriction(Bindable.BindRestriction bindRestriction) Returnstrueif the specified bind restriction has been added.inthashCode()static <T> Bindable<T>of(cn.taketoday.core.ResolvableType type) Create a newBindableof the specified type.static <T> Bindable<T>Create a newBindableof the specified type.static <T> Bindable<T>ofInstance(T instance) Create a newBindableof the type of the specified instance with an existing value equal to the instance.toString()withAnnotations(Annotation... annotations) Create an updatedBindableinstance with the specified annotations.withBindRestrictions(Bindable.BindRestriction... additionalRestrictions) Create an updatedBindableinstance with additional bind restrictions.withExistingValue(T existingValue) Create an updatedBindableinstance with an existing value.withSuppliedValue(Supplier<T> suppliedValue) Create an updatedBindableinstance with a value supplier.
-
方法详细资料
-
getType
public cn.taketoday.core.ResolvableType getType()Return the type of the item to bind.- 返回:
- the type being bound
-
getBoxedType
public cn.taketoday.core.ResolvableType getBoxedType()Return the boxed type of the item to bind.- 返回:
- the boxed type for the item being bound
-
getValue
Return a supplier that provides the object value ornull.- 返回:
- the value or
null
-
getAnnotations
Return any associated annotations that could affect binding.- 返回:
- the associated annotations
-
getAnnotation
Return a single associated annotations that could affect binding.- 类型参数:
A- the annotation type- 参数:
type- annotation type- 返回:
- the associated annotation or
null
-
hasBindRestriction
Returnstrueif the specified bind restriction has been added.- 参数:
bindRestriction- the bind restriction to check- 返回:
- if the bind restriction has been added
-
equals
-
hashCode
public int hashCode() -
toString
-
withAnnotations
Create an updatedBindableinstance with the specified annotations.- 参数:
annotations- the annotations- 返回:
- an updated
Bindable
-
withExistingValue
Create an updatedBindableinstance with an existing value.- 参数:
existingValue- the existing value- 返回:
- an updated
Bindable
-
withSuppliedValue
Create an updatedBindableinstance with a value supplier.- 参数:
suppliedValue- the supplier for the value- 返回:
- an updated
Bindable
-
withBindRestrictions
Create an updatedBindableinstance with additional bind restrictions.- 参数:
additionalRestrictions- any additional restrictions to apply- 返回:
- an updated
Bindable
-
ofInstance
Create a newBindableof the type of the specified instance with an existing value equal to the instance.- 类型参数:
T- the source type- 参数:
instance- the instance (must not benull)- 返回:
- a
Bindableinstance - 另请参阅:
-
of
Create a newBindableof the specified type.- 类型参数:
T- the source type- 参数:
type- the type (must not benull)- 返回:
- a
Bindableinstance - 另请参阅:
-
listOf
- 类型参数:
E- the element type- 参数:
elementType- the list element type- 返回:
- a
Bindableinstance
-
setOf
- 类型参数:
E- the element type- 参数:
elementType- the set element type- 返回:
- a
Bindableinstance
-
mapOf
- 类型参数:
K- the key typeV- the value type- 参数:
keyType- the map key typevalueType- the map value type- 返回:
- a
Bindableinstance
-
of
Create a newBindableof the specified type.
-