Class StructureViewBean.Builder
Object
Builder
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- StructureViewBean
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 Summary
ConstructorsConstructorDescriptionBuilder()Creates an empty builder.Builder(StructureViewBean bean) Creates a builder that is initialized with all properties from the specified bean. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an immutableStructureViewBeanfrom the state in this builder.clone()getId()getName()getOwner()booleanhasOwner()booleanbooleanisValid()booleanvoidsetDescription(String description) Sets the description of the view.voidSets the ID of the viewvoidSets the name of the viewvoidsetOwner(PermissionSubject owner) Sets the owner of this view.voidsetPermissions(Collection<? extends PermissionRule> permissions) Sets the permission rules.voidsetSpecification(ViewSpecification.Builder specification) Updates view specification buildertoString()voidUpdates properties of the target builder.
-
Constructor Details
-
Builder
public Builder()Creates an empty builder. -
Builder
Creates a builder that is initialized with all properties from the specified bean.
-
-
Method Details
-
clone
-
updatePropertiesOf
Updates properties of the target builder. Each non-null property in this bean is written into target.- Parameters:
target- target bean
-
getId
- Returns:
- the ID of the view or
nullif not set
-
setId
Sets the ID of the view- Parameters:
id- the ID ornullto clear the property
-
getName
- Returns:
- the name of the view or
nullif not set
-
setName
Sets the name of the view- Parameters:
name- the name of the view ornullto clear the property
-
getDescription
- Returns:
- the description of the view or
nullif not set
-
setDescription
Sets the description of the view.- Parameters:
description- the description of the view ornullto clear the property
-
getOwner
- Returns:
- the owner of the view, or
nullif not set or if no owner is specified
-
hasOwner
public boolean hasOwner()- Returns:
- true if an owner is specified in this builder
-
setOwner
Sets the owner of this view.- Parameters:
owner- owner ornullto unset.
-
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
Sets the permission rules.- Parameters:
permissions- the list of permission rules for the view, ornullto clear the property
-
getSpecification
- Returns:
- view specification builder, which can be modified
-
setSpecification
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
Creates an immutableStructureViewBeanfrom the state in this builder.- Returns:
- a new
StructureViewBean - Throws:
IllegalStateException- if the current state is not valid
-
toString
-