T
- the source typepublic final class Bindable<T>
extends java.lang.Object
Binder
.of(Class)
,
of(ResolvableType)
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> type)
Return a single associated annotations that could affect binding.
|
java.lang.annotation.Annotation[] |
getAnnotations()
Return any associated annotations that could affect binding.
|
org.springframework.core.ResolvableType |
getBoxedType()
Return the boxed type of the item to bind.
|
org.springframework.core.ResolvableType |
getType()
Return the type of the item to bind.
|
java.util.function.Supplier<T> |
getValue()
Return a supplier that provides the object value or
null . |
int |
hashCode() |
static <E> Bindable<java.util.List<E>> |
listOf(java.lang.Class<E> elementType)
Create a new
Bindable List of the specified element type. |
static <K,V> Bindable<java.util.Map<K,V>> |
mapOf(java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Create a new
Bindable Map of the specified key and value type. |
static <T> Bindable<T> |
of(java.lang.Class<T> type)
Create a new
Bindable of the specified type. |
static <T> Bindable<T> |
of(org.springframework.core.ResolvableType type)
Create a new
Bindable of the specified type. |
static <T> Bindable<T> |
ofInstance(T instance)
Create a new
Bindable of the type of the specified instance with an
existing value equal to the instance. |
static <E> Bindable<java.util.Set<E>> |
setOf(java.lang.Class<E> elementType)
Create a new
Bindable Set of the specified element type. |
java.lang.String |
toString() |
Bindable<T> |
withAnnotations(java.lang.annotation.Annotation... annotations)
Create an updated
Bindable instance with the specified annotations. |
Bindable<T> |
withExistingValue(T existingValue)
Create an updated
Bindable instance with an existing value. |
Bindable<T> |
withSuppliedValue(java.util.function.Supplier<T> suppliedValue)
Create an updated
Bindable instance with a value supplier. |
public org.springframework.core.ResolvableType getType()
public org.springframework.core.ResolvableType getBoxedType()
public java.util.function.Supplier<T> getValue()
null
.null
public java.lang.annotation.Annotation[] getAnnotations()
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> type)
A
- the annotation typetype
- annotation typenull
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Bindable<T> withAnnotations(java.lang.annotation.Annotation... annotations)
Bindable
instance with the specified annotations.annotations
- the annotationsBindable
public Bindable<T> withExistingValue(T existingValue)
Bindable
instance with an existing value.existingValue
- the existing valueBindable
public Bindable<T> withSuppliedValue(java.util.function.Supplier<T> suppliedValue)
Bindable
instance with a value supplier.suppliedValue
- the supplier for the valueBindable
public static <T> Bindable<T> ofInstance(T instance)
Bindable
of the type of the specified instance with an
existing value equal to the instance.T
- the source typeinstance
- the instance (must not be null
)Bindable
instanceof(ResolvableType)
,
withExistingValue(Object)
public static <T> Bindable<T> of(java.lang.Class<T> type)
Bindable
of the specified type.T
- the source typetype
- the type (must not be null
)Bindable
instanceof(ResolvableType)
public static <E> Bindable<java.util.List<E>> listOf(java.lang.Class<E> elementType)
Bindable
List
of the specified element type.E
- the element typeelementType
- the list element typeBindable
instancepublic static <E> Bindable<java.util.Set<E>> setOf(java.lang.Class<E> elementType)
Bindable
Set
of the specified element type.E
- the element typeelementType
- the set element typeBindable
instancepublic static <K,V> Bindable<java.util.Map<K,V>> mapOf(java.lang.Class<K> keyType, java.lang.Class<V> valueType)
Bindable
Map
of the specified key and value type.K
- the key typeV
- the value typekeyType
- the map key typevalueType
- the map value typeBindable
instance