Class Grant.Builder<T extends Grant.Builder<T>>

  • Type Parameters:
    T - type of the builder, needed for builder inheritance
    All Implemented Interfaces:
    Builder<Grant>, Supplier<Grant>
    Direct Known Subclasses:
    Role.Builder
    Enclosing class:
    Grant

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

      • Builder

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

      • build

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

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

        public T 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 T 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 T 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 T 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