Class SafeConstructor.Builder
java.lang.Object
cloud.opencode.base.yml.security.SafeConstructor.Builder
- Enclosing interface:
SafeConstructor
Builder for SafeConstructor
SafeConstructor 的构建器
- Since:
- JDK 25, opencode-base-yml V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionallowPackage(String packageName) Allows all types in a package.allowPackages(String... packages) Allows types in multiple packages.Allows a specific type.allowTypes(Class<?>... types) Allows multiple types.build()Builds the safe constructor.customValidator(Predicate<Class<?>> validator) Sets a custom type validator.
-
Method Details
-
allowType
Allows a specific type. 允许特定类型。- Parameters:
type- the type to allow | 要允许的类型- Returns:
- this builder | 此构建器
-
allowTypes
Allows multiple types. 允许多个类型。- Parameters:
types- the types to allow | 要允许的类型- Returns:
- this builder | 此构建器
-
allowPackage
Allows all types in a package. 允许包中的所有类型。- Parameters:
packageName- the package name | 包名- Returns:
- this builder | 此构建器
-
allowPackages
Allows types in multiple packages. 允许多个包中的类型。- Parameters:
packages- the package names | 包名- Returns:
- this builder | 此构建器
-
customValidator
Sets a custom type validator. 设置自定义类型验证器。- Parameters:
validator- the validator | 验证器- Returns:
- this builder | 此构建器
-
build
Builds the safe constructor. 构建安全构造器。- Returns:
- the safe constructor | 安全构造器
-