Class ViewSpecification.Builder
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- ViewSpecification
A builder for ViewSpecification, also used to serialize view specification into JSON.
This class is not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Constructs empty builder.Builder(ViewSpecification specification) Constructs a builder that copies the specification passed as a parameter. -
Method Summary
Modifier and TypeMethodDescriptionAdds a column identified by the columnkeyand automatically generatedcsid.Adds a column identified by the columnkeyandcsid.addColumns(ViewSpecification.Column.Builder... columns) Adds passed column builders as columns for the future view specification.addFieldColumn(String field) Adds a field column, identified by JIRA field ID.addFieldSumColumn(String field) Adds an aggregate column that sums up the given JIRA field.addIconsColumn(String... fields) Adds an "Icons" column showing the icon representations of the given fields, in that order.Adds "main" column to the view, which displays issue summary, indented to reflect the depth.Adds the "Progress" column provided by Structure plugin.addTimeAggregateColumn(String field) Adds "Total Time" column, based on one of the three JIRA time fields.Adds the "TP" column provided by Structure plugin.build()Builds an instance ofViewSpecification.clone()intgetPins()intremoveColumn(String csid) Removes a column identified bycsid.setColumnDisplayMode(int columnDisplayMode) Set column display modevoidsetColumns(List<ViewSpecification.Column.Builder> columns) Changes the current column builders to the passed list.setRowDisplayMode(int rowDisplayMode) Set row display modetoString()
-
Constructor Details
-
Builder
public Builder()Constructs empty builder. -
Builder
Constructs a builder that copies the specification passed as a parameter.- Parameters:
specification- a specification to copy
-
-
Method Details
-
clone
-
addColumns
Adds passed column builders as columns for the future view specification.- Parameters:
columns- columns- Returns:
- this builder
-
removeColumn
Removes a column identified bycsid.- Parameters:
csid- the ID of the column to be removed- Returns:
- this builder
-
addColumn
Adds a column identified by the column
keyandcsid.Although key and csid arguments could be null, the resulting builder will not have a valid state - each column in the specification must have csid and key.
- Parameters:
key- column keycsid- column csid- Returns:
- the builder for the column
- See Also:
-
addColumn
Adds a column identified by the column
keyand automatically generatedcsid.- Parameters:
key- column key- Returns:
- the builder for the column
- See Also:
-
addMainColumn
Adds "main" column to the view, which displays issue summary, indented to reflect the depth.
- Returns:
- this builder
-
addFieldColumn
Adds a field column, identified by JIRA field ID.
Field id is either one of the system fields (see
com.atlassian.jira.issue.IssueFieldConstants) or a custom field id in form ofcustomfield_NNNNN.- Parameters:
field- JIRA field id- Returns:
- this builder
-
addTimeAggregateColumn
Adds "Total Time" column, based on one of the three JIRA time fields.
Parameter
fieldmust be one of the following:"timeoriginalestimate""timeestimate""timespent"
- Parameters:
field- JIRA time field id- Returns:
- this builder
-
addFieldSumColumn
Adds an aggregate column that sums up the given JIRA field.
Parameter
fieldmust be one of the following:"timeoriginalestimate""timeestimate""timespent""votes"- any numeric custom field id
- Parameters:
field- JIRA field id- Returns:
- this builder
-
addProgressColumn
Adds the "Progress" column provided by Structure plugin.
- Returns:
- this builder
-
addTPColumn
Adds the "TP" column provided by Structure plugin.
- Returns:
- this builder
-
addIconsColumn
Adds an "Icons" column showing the icon representations of the given fields, in that order.
Each
fieldmust be one of the following:"project""issuetype""priority""status""reporter""assignee"
- Parameters:
fields- JIRA field ids- Returns:
- this builder
-
build
Builds an instance ofViewSpecification. If any column builder has invalid state, it is skipped and not put into the final view.- Returns:
- the created
ViewSpecification
-
getColumns
- Returns:
- the current column builders
-
setColumns
Changes the current column builders to the passed list.- Parameters:
columns- column builders
-
setColumnDisplayMode
Set column display mode- Parameters:
columnDisplayMode- new column display mode- Returns:
- this builder
- See Also:
-
setRowDisplayMode
Set row display mode- Parameters:
rowDisplayMode- new row display mode- Returns:
- this builder
- See Also:
-
getColumnDisplayMode
public int getColumnDisplayMode()- Returns:
- the current column display mode
- See Also:
-
getRowDisplayMode
public int getRowDisplayMode()- Returns:
- the current row display mode
- See Also:
-
setPins
-
getPins
- Returns:
- list of csid of pinned columns
- See Also:
-
toString
-