T
- The source typepublic final class Bindable<T> extends Object
Binder
.of(Class)
,
of(ResolvableType)
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Annotation[] |
getAnnotations()
Return any associated annotations that could affect binding.
|
org.springframework.core.ResolvableType |
getBoxedType() |
org.springframework.core.ResolvableType |
getType()
Return the type of the item to bind.
|
Supplier<T> |
getValue()
Return a supplier that provides the object value or
null . |
int |
hashCode() |
static <E> Bindable<List<E>> |
listOf(Class<E> elementType)
|
static <K,V> Bindable<Map<K,V>> |
mapOf(Class<K> keyType,
Class<V> valueType)
|
static <T> Bindable<T> |
of(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<Set<E>> |
setOf(Class<E> elementType)
|
String |
toString() |
Bindable<T> |
withAnnotations(Annotation... annotations)
Create an updated
Bindable instance with the specified annotations. |
Bindable<T> |
withExistingValue(T existingValue) |
Bindable<T> |
withSuppliedValue(Supplier<T> suppliedValue) |
public org.springframework.core.ResolvableType getType()
public org.springframework.core.ResolvableType getBoxedType()
public Supplier<T> getValue()
null
.null
public Annotation[] getAnnotations()
public Bindable<T> withAnnotations(Annotation... annotations)
Bindable
instance with the specified annotations.annotations
- the annotationsBindable
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(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<List<E>> listOf(Class<E> elementType)
E
- the element typeelementType
- the list element typeBindable
instancepublic static <E> Bindable<Set<E>> setOf(Class<E> elementType)
E
- the element typeelementType
- the set element typeBindable
instancepublic static <K,V> Bindable<Map<K,V>> mapOf(Class<K> keyType, Class<V> valueType)
K
- the key typeV
- the value typekeyType
- the map key typevalueType
- the map value typeBindable
instanceCopyright © 2017 Pivotal Software, Inc.. All rights reserved.