T
- The bean type.public interface BeanWrapper<T> extends AnnotationMetadataProvider
BeanIntrospection
.EMPTY
Modifier and Type | Method and Description |
---|---|
static <T2> Optional<BeanWrapper<T2>> |
findWrapper(Class<T2> type,
T2 bean)
Obtain a bean wrapper for the given bean.
|
static <T2> Optional<BeanWrapper<T2>> |
findWrapper(T2 bean)
Obtain a bean wrapper for the given bean.
|
T |
getBean() |
default Collection<BeanProperty<T,Object>> |
getBeanProperties()
The properties.
|
BeanIntrospection<T> |
getIntrospection() |
default <P> Optional<P> |
getProperty(String name,
Argument<P> type)
Get the property of the given name and type.
|
default <P> Optional<P> |
getProperty(String name,
ArgumentConversionContext<P> context)
Get the property of the given name and type.
|
default <P> Optional<P> |
getProperty(String name,
Class<P> type)
Get the property of the given name and type.
|
default String[] |
getPropertyNames()
The property names.
|
default <P> P |
getRequiredProperty(String name,
Argument<P> argument)
Get the property value of the given type or throw an exception if it is unobtainable.
|
default <P> P |
getRequiredProperty(String name,
ArgumentConversionContext<P> context)
Get the property value of the given type or throw an exception if it is unobtainable.
|
default <P> P |
getRequiredProperty(String name,
Class<P> type)
Get the property value of the given type or throw an exception if it is unobtainable.
|
static <T2> BeanWrapper<T2> |
getWrapper(Class<T2> type,
T2 bean)
Obtain a bean wrapper for the given bean.
|
static <T2> BeanWrapper<T2> |
getWrapper(T2 bean)
Obtain a bean wrapper for the given bean.
|
default BeanWrapper<T> |
setProperty(String name,
Object value)
Sets a property of the given name to the given value.
|
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
@NonNull BeanIntrospection<T> getIntrospection()
@NonNull default String[] getPropertyNames()
@NonNull default Collection<BeanProperty<T,Object>> getBeanProperties()
@NonNull default <P> P getRequiredProperty(@NonNull String name, @NonNull Class<P> type)
P
- The property generic typename
- The nametype
- The typeIntrospectionException
- if no property existsConversionErrorException
- if the property cannot be converted to the given typedefault <P> P getRequiredProperty(@NonNull String name, @NonNull Argument<P> argument)
P
- The property generic typename
- The nameargument
- The argument typeIntrospectionException
- if no property existsConversionErrorException
- if the property cannot be converted to the given type@NonNull default <P> P getRequiredProperty(@NonNull String name, @NonNull ArgumentConversionContext<P> context)
P
- The property generic typename
- The namecontext
- The typeIntrospectionException
- if no property existsConversionErrorException
- if the property cannot be converted to the given type@NonNull default <P> Optional<P> getProperty(@NonNull String name, @NonNull Class<P> type)
P
- The required generic typename
- The nametype
- The required typedefault <P> Optional<P> getProperty(@NonNull String name, Argument<P> type)
P
- The required generic typename
- The nametype
- The required typedefault <P> Optional<P> getProperty(@NonNull String name, ArgumentConversionContext<P> context)
P
- The required generic typename
- The namecontext
- The conversion contextdefault BeanWrapper<T> setProperty(@NonNull String name, @Nullable Object value)
name
- The namevalue
- The valueConversionErrorException
- if the value cannot be converted to the underlying property type.@NonNull static <T2> BeanWrapper<T2> getWrapper(@NonNull T2 bean)
T2
- The bean typebean
- The beanIntrospectionException
- If the wrapper cannot be created@NonNull static <T2> Optional<BeanWrapper<T2>> findWrapper(@NonNull T2 bean)
T2
- The bean typebean
- The beanIntrospectionException
- If the wrapper cannot be created@NonNull static <T2> Optional<BeanWrapper<T2>> findWrapper(Class<T2> type, @NonNull T2 bean)
T2
- The bean typetype
- the typebean
- The beanIntrospectionException
- If the wrapper cannot be created@NonNull static <T2> BeanWrapper<T2> getWrapper(Class<T2> type, @NonNull T2 bean)
T2
- The bean typetype
- the typebean
- The beanIntrospectionException
- If the wrapper cannot be created