Class RoleDTO.Builder<S extends RoleDTO.Builder>

java.lang.Object
org.apache.gravitino.dto.authorization.RoleDTO.Builder<S>
Type Parameters:
S - The type of the builder instance.
Enclosing class:
RoleDTO

public static class RoleDTO.Builder<S extends RoleDTO.Builder> extends Object
Builder class for constructing a RoleDTO instance.
  • Field Details

    • name

      protected String name
      The name of the role.
    • audit

      protected AuditDTO audit
      The audit information of the role.
    • properties

      protected Map<String,String> properties
      The properties of the role.
    • securableObjects

      protected SecurableObjectDTO[] securableObjects
      The securable objects of the role.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withName

      public S withName(String name)
      Sets the name of the role.
      Parameters:
      name - The name of the role.
      Returns:
      The builder instance.
    • withProperties

      public S withProperties(Map<String,String> properties)
      Sets the properties of the role.
      Parameters:
      properties - The properties of the role.
      Returns:
      The builder instance.
    • withSecurableObjects

      public S withSecurableObjects(SecurableObjectDTO[] securableObjects)
      Sets the securable objects of the role.
      Parameters:
      securableObjects - The securable objects of the role.
      Returns:
      The builder instance.
    • withAudit

      public S withAudit(AuditDTO audit)
      Sets the audit information of the role.
      Parameters:
      audit - The audit information of the role.
      Returns:
      The builder instance.
    • build

      public RoleDTO build()
      Builds an instance of RoleDTO using the builder's properties.
      Returns:
      An instance of RoleDTO.
      Throws:
      IllegalArgumentException - If the name or audit are not set.