Class Grant.Builder<B extends Grant.Builder<B>>

java.lang.Object
io.helidon.security.Grant.Builder<B>
Type Parameters:
B - type of the builder, needed for builder inheritance
All Implemented Interfaces:
Builder<B,Grant>, Supplier<Grant>
Direct Known Subclasses:
Role.Builder
Enclosing class:
Grant

public static class Grant.Builder<B extends Grant.Builder<B>> extends Object implements Builder<B,Grant>
A fluent API builder for Grant to be extended by other Grant implementations.
  • Constructor Details

    • Builder

      protected Builder()
      Create a new instance.
  • Method Details

    • build

      public Grant build()
      Description copied from interface: Builder
      Build the instance from this builder.
      Specified by:
      build in interface Builder<B extends Grant.Builder<B>,Grant>
      Returns:
      instance of the built type
    • type

      public B type(String type)
      Configure type of this grant.
      Parameters:
      type - type name, known types are "role" and "scope"
      Returns:
      updated builder instance
    • name

      public B name(String name)
      Name of this grant.
      Parameters:
      name - logical name of this grant (e.g. "admin", "calendar_read" etc.)
      Returns:
      updated builder instance
    • origin

      public B origin(String origin)
      Origin of this grant (e.g. name of a system).
      Parameters:
      origin - who granted this grant?
      Returns:
      updated builder instance
    • attributes

      public B attributes(AbacSupport attribs)
      Attributes of this grant.
      Parameters:
      attribs - Attributes to add to this grant, allowing us to extend the information known (such as "nickname", "cn" etc.)
      Returns:
      updated builder instance
    • addAttribute

      public B addAttribute(String key, Object value)
      Add and attribute to this grant.
      Parameters:
      key - name of the attribute
      value - value of the attribute
      Returns:
      updated builder instance