Class StructureViewBean.Builder

Object
Builder
All Implemented Interfaces:
Cloneable
Enclosing class:
StructureViewBean

public static class StructureViewBean.Builder extends Object implements Cloneable

A builder class for StructureViewBean, this class can be also used as the input for StructureView.update(com.almworks.jira.structure.api.view.StructureViewBean.Builder).

This class is not thread-safe.

  • Constructor Details

    • Builder

      public Builder()
      Creates an empty builder.
    • Builder

      public Builder(@Nullable StructureViewBean bean)
      Creates a builder that is initialized with all properties from the specified bean.
  • Method Details

    • clone

      public StructureViewBean.Builder clone()
      Overrides:
      clone in class Object
    • updatePropertiesOf

      public void updatePropertiesOf(StructureViewBean.Builder target)
      Updates properties of the target builder. Each non-null property in this bean is written into target.
      Parameters:
      target - target bean
    • getId

      public Long getId()
      Returns:
      the ID of the view or null if not set
    • setId

      public void setId(Long id)
      Sets the ID of the view
      Parameters:
      id - the ID or null to clear the property
    • getName

      public String getName()
      Returns:
      the name of the view or null if not set
    • setName

      public void setName(String name)
      Sets the name of the view
      Parameters:
      name - the name of the view or null to clear the property
    • getDescription

      public String getDescription()
      Returns:
      the description of the view or null if not set
    • setDescription

      public void setDescription(String description)
      Sets the description of the view.
      Parameters:
      description - the description of the view or null to clear the property
    • getOwner

      public PermissionSubject getOwner()
      Returns:
      the owner of the view, or null if not set or if no owner is specified
    • hasOwner

      public boolean hasOwner()
      Returns:
      true if an owner is specified in this builder
    • setOwner

      public void setOwner(PermissionSubject owner)
      Sets the owner of this view.
      Parameters:
      owner - owner or null to unset.
    • getPermissions

      @NotNull public List<PermissionRule> getPermissions()
      Returns:
      permission rules for the view, or empty list if not set
    • hasPermissions

      public boolean hasPermissions()
      Returns:
      true if permissions are defined in this builder
    • setPermissions

      public void setPermissions(@Nullable Collection<? extends PermissionRule> permissions)
      Sets the permission rules.
      Parameters:
      permissions - the list of permission rules for the view, or null to clear the property
    • getSpecification

      public ViewSpecification.Builder getSpecification()
      Returns:
      view specification builder, which can be modified
    • setSpecification

      public void setSpecification(ViewSpecification.Builder specification)
      Updates view specification builder
      Parameters:
      specification - new view specification builder (it may be updated after it is installed into this builder)
    • isValid

      public boolean isValid()
      Returns:
      true if the builder contains valid data for the view: that is, if it has a name, a specification and a valid ID.
    • isValidExceptId

      public boolean isValidExceptId()
      Returns:
      true if the builder contains valid data that is needed to create a view. Same as isValid() but ID may be missing.
    • build

      @NotNull public StructureViewBean build() throws IllegalStateException
      Creates an immutable StructureViewBean from the state in this builder.
      Returns:
      a new StructureViewBean
      Throws:
      IllegalStateException - if the current state is not valid
    • toString

      public String toString()
      Overrides:
      toString in class Object