Class AclEntry.Builder

  • Enclosing class:
    AclEntry

    public static final class AclEntry.Builder
    extends java.lang.Object
    Builder for AclEntry.
    • Constructor Detail

      • Builder

        public Builder()
        Creates a new builder where type is null, subject is an empty string, and no action is permitted.
    • Method Detail

      • setType

        public AclEntry.Builder setType​(AclEntryType type)
        Sets the type of the entry.
        Parameters:
        type - the type of the entry
        Returns:
        the builder
      • setSubject

        public AclEntry.Builder setSubject​(java.lang.String subject)
        Sets subject of this entry. If the entry is of type OWNING_USER or NAMED_USER, then the subject is the username. If the entry is of type OWNING_GROUP or NAMED_GROUP, then the subject is the group name. For other types, the subject should be an empty string.
        Parameters:
        subject - the subject
        Returns:
        the builder
      • setActions

        public AclEntry.Builder setActions​(AclActions actions)
        Sets a copy of actions for this entry.
        Parameters:
        actions - the actions to be copied from
        Returns:
        the builder
      • addAction

        public AclEntry.Builder addAction​(AclAction action)
        Adds a permitted action.
        Parameters:
        action - the permitted action
        Returns:
        the builder
      • setIsDefault

        public AclEntry.Builder setIsDefault​(boolean isDefault)
        Set this AclEntry to be for default ACL.
        Parameters:
        isDefault - whether this entry is default
        Returns:
        the builder
      • build

        public AclEntry build()
        Returns:
        a new AclEntry
        Throws:
        java.lang.IllegalStateException - if type if null, or if type is either NAMED_USER or NAMED_GROUP while subject is empty