Class SafeConstructor.Builder

java.lang.Object
cloud.opencode.base.yml.security.SafeConstructor.Builder
Enclosing interface:
SafeConstructor

public static final class SafeConstructor.Builder extends Object
Builder for SafeConstructor SafeConstructor 的构建器
Since:
JDK 25, opencode-base-yml V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • allowType

      public SafeConstructor.Builder allowType(Class<?> type)
      Allows a specific type. 允许特定类型。
      Parameters:
      type - the type to allow | 要允许的类型
      Returns:
      this builder | 此构建器
    • allowTypes

      public SafeConstructor.Builder allowTypes(Class<?>... types)
      Allows multiple types. 允许多个类型。
      Parameters:
      types - the types to allow | 要允许的类型
      Returns:
      this builder | 此构建器
    • allowPackage

      public SafeConstructor.Builder allowPackage(String packageName)
      Allows all types in a package. 允许包中的所有类型。
      Parameters:
      packageName - the package name | 包名
      Returns:
      this builder | 此构建器
    • allowPackages

      public SafeConstructor.Builder allowPackages(String... packages)
      Allows types in multiple packages. 允许多个包中的类型。
      Parameters:
      packages - the package names | 包名
      Returns:
      this builder | 此构建器
    • customValidator

      public SafeConstructor.Builder customValidator(Predicate<Class<?>> validator)
      Sets a custom type validator. 设置自定义类型验证器。
      Parameters:
      validator - the validator | 验证器
      Returns:
      this builder | 此构建器
    • build

      public SafeConstructor build()
      Builds the safe constructor. 构建安全构造器。
      Returns:
      the safe constructor | 安全构造器