Class AllowList.Builder

java.lang.Object
cloud.opencode.base.expression.sandbox.AllowList.Builder
Enclosing class:
AllowList

public static class AllowList.Builder extends Object
Builder for AllowList AllowList 构建器
Since:
JDK 25, opencode-base-expression V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • allowClass

      public AllowList.Builder allowClass(String className)
      Allow a class 允许一个类
      Parameters:
      className - the class name (supports * wildcard) | 类名(支持 * 通配符)
      Returns:
      this builder | 此构建器
    • allowClass

      public AllowList.Builder allowClass(Class<?> clazz)
      Allow a class 允许一个类
      Parameters:
      clazz - the class | 类
      Returns:
      this builder | 此构建器
    • allowClasses

      public AllowList.Builder allowClasses(String... classNames)
      Allow multiple classes 允许多个类
      Parameters:
      classNames - the class names | 类名
      Returns:
      this builder | 此构建器
    • allowMethod

      public AllowList.Builder allowMethod(String methodName)
      Allow a method 允许一个方法
      Parameters:
      methodName - the method name (supports * wildcard) | 方法名(支持 * 通配符)
      Returns:
      this builder | 此构建器
    • allowMethods

      public AllowList.Builder allowMethods(String... methodNames)
      Allow multiple methods 允许多个方法
      Parameters:
      methodNames - the method names | 方法名
      Returns:
      this builder | 此构建器
    • allowProperty

      public AllowList.Builder allowProperty(String propertyName)
      Allow a property 允许一个属性
      Parameters:
      propertyName - the property name (supports * wildcard) | 属性名(支持 * 通配符)
      Returns:
      this builder | 此构建器
    • allowProperties

      public AllowList.Builder allowProperties(String... propertyNames)
      Allow multiple properties 允许多个属性
      Parameters:
      propertyNames - the property names | 属性名
      Returns:
      this builder | 此构建器
    • allowAllByDefault

      public AllowList.Builder allowAllByDefault(boolean allow)
      Set allow all by default 设置默认允许所有
      Parameters:
      allow - true to allow all by default | true 表示默认允许所有
      Returns:
      this builder | 此构建器
    • build

      public AllowList build()
      Build the allow list 构建白名单
      Returns:
      the allow list | 白名单