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) |
<A extends Annotation> |
getAnnotation(Class<A> type)
Return a single associated annotations that could affect binding.
|
Annotation[] |
getAnnotations()
Return any associated annotations that could affect binding.
|
org.springframework.core.ResolvableType |
getBoxedType()
Return the boxed type of the item to bind.
|
Predicate<Constructor<?>> |
getConstructorFilter()
Return the constructor filter that can be used to limit the constructors that are
considered when binding.
|
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> |
withConstructorFilter(Predicate<Constructor<?>> constructorFilter)
Create an updated
Bindable instance with a constructor filter that can be
used to limit the constructors considered when binding. |
Bindable<T> |
withExistingValue(T existingValue)
Create an updated
Bindable instance with an existing value. |
Bindable<T> |
withSuppliedValue(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 Supplier<T> getValue()
null
.null
public Annotation[] getAnnotations()
public <A extends Annotation> A getAnnotation(Class<A> type)
A
- the annotation typetype
- annotation typenull
public Predicate<Constructor<?>> getConstructorFilter()
public Bindable<T> withAnnotations(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(Supplier<T> suppliedValue)
Bindable
instance with a value supplier.suppliedValue
- the supplier for the valueBindable
public Bindable<T> withConstructorFilter(Predicate<Constructor<?>> constructorFilter)
Bindable
instance with a constructor filter that can be
used to limit the constructors considered when binding.constructorFilter
- the constructor filter to useBindable
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 © 2019 Pivotal Software, Inc.. All rights reserved.