Class BeanCopier.Builder<S,T>
java.lang.Object
cloud.opencode.base.reflect.bean.BeanCopier.Builder<S,T>
- Type Parameters:
S- the source type | 源类型T- the target type | 目标类型
- Enclosing class:
BeanCopier<S,T>
Builder for BeanCopier
BeanCopier构建器
- Since:
- JDK 25, opencode-base-reflect V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionBeanCopier<S, T> build()Builds the BeanCopier 构建BeanCopierAdds a converter for a property 为属性添加转换器Excludes properties from copying 从复制中排除属性ignoreNulls(boolean ignoreNulls) Sets whether to ignore null values 设置是否忽略null值Maps source property to target property 映射源属性到目标属性when(BiPredicate<String, Object> condition) Sets a condition for copying 设置复制条件
-
Method Details
-
map
Maps source property to target property 映射源属性到目标属性- Parameters:
sourceProperty- the source property name | 源属性名targetProperty- the target property name | 目标属性名- Returns:
- this builder | 此构建器
-
convert
-
exclude
Excludes properties from copying 从复制中排除属性- Parameters:
properties- the property names | 属性名- Returns:
- this builder | 此构建器
-
ignoreNulls
Sets whether to ignore null values 设置是否忽略null值- Parameters:
ignoreNulls- whether to ignore | 是否忽略- Returns:
- this builder | 此构建器
-
when
Sets a condition for copying 设置复制条件- Parameters:
condition- the condition (property name, value) -> boolean | 条件- Returns:
- this builder | 此构建器
-
build
Builds the BeanCopier 构建BeanCopier- Returns:
- the BeanCopier | BeanCopier
-