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>

public static class BeanCopier.Builder<S,T> extends Object
Builder for BeanCopier BeanCopier构建器
Since:
JDK 25, opencode-base-reflect V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • map

      public BeanCopier.Builder<S,T> map(String sourceProperty, String targetProperty)
      Maps source property to target property 映射源属性到目标属性
      Parameters:
      sourceProperty - the source property name | 源属性名
      targetProperty - the target property name | 目标属性名
      Returns:
      this builder | 此构建器
    • convert

      public BeanCopier.Builder<S,T> convert(String sourceProperty, Function<Object,Object> converter)
      Adds a converter for a property 为属性添加转换器
      Parameters:
      sourceProperty - the source property name | 源属性名
      converter - the converter | 转换器
      Returns:
      this builder | 此构建器
    • exclude

      public BeanCopier.Builder<S,T> exclude(String... properties)
      Excludes properties from copying 从复制中排除属性
      Parameters:
      properties - the property names | 属性名
      Returns:
      this builder | 此构建器
    • ignoreNulls

      public BeanCopier.Builder<S,T> ignoreNulls(boolean ignoreNulls)
      Sets whether to ignore null values 设置是否忽略null值
      Parameters:
      ignoreNulls - whether to ignore | 是否忽略
      Returns:
      this builder | 此构建器
    • when

      public BeanCopier.Builder<S,T> when(BiPredicate<String,Object> condition)
      Sets a condition for copying 设置复制条件
      Parameters:
      condition - the condition (property name, value) -> boolean | 条件
      Returns:
      this builder | 此构建器
    • build

      public BeanCopier<S,T> build()
      Builds the BeanCopier 构建BeanCopier
      Returns:
      the BeanCopier | BeanCopier