@Immutable public class DashboardState extends Object implements Serializable
An immutable representation of a dashboard. A dashboard's state consists of
DashboardId, used to uniquely identify the dashboard within the systemLayout that describes how many columns appear on the dashboard and how large they should be with
respect to one anotherGadgetStates that represent the gadgets in the dashboard represented by this DashboardState
are found in columnsDashboardState objects should be built using the builders. At a minimum, the DashboardId
and the title are required.
By doing a static import of the dashboard(DashboardId) method, you can
create a DashboardState object with:
DashboardState state = dashboard(DashboardId.from(1000)).title("Menagerie").build();
Or you can create a new DashboardState object from an existing one:
DashboardState state = dashboard(originalState).layout(Layout.AAA).build();
DashboardState implements the Serializable marker interface. The marker is only implemented so that
DashboardState objects may be distributed among remote systems that might be sharing a cache or need to
transfer DashboardStates for other reasons. Serialization is not meant to be used as a means of
persisting DashboardState objects between JVM restarts.
| Modifier and Type | Class and Description |
|---|---|
static class |
DashboardState.Builder
A builder that allows the
Layout or the columns of the DashboardState under construction to
be set. |
static class |
DashboardState.ColumnIndex
There are a predetermined number of columns that a dashboard can contain, and
ColumnIndex is the enumeration
of those columns. |
static class |
DashboardState.TitleBuilder
A builder that allows you to set the title of the
DashboardState object under construction. |
| Modifier and Type | Method and Description |
|---|---|
DashboardState |
appendGadgetToColumn(GadgetState gadgetState,
DashboardState.ColumnIndex index)
Deprecated.
|
DashboardState |
appendItemToColumn(DashboardItemState itemState,
DashboardState.ColumnIndex index)
Returns a new DashboardState built with the same data as
this, except that the column with index
index has had a new gadget added to its bottom |
static DashboardState.TitleBuilder |
dashboard(DashboardId id)
Factory method to create a new builder which can be used to create
DashboardState objects. |
static DashboardState.Builder |
dashboard(DashboardState state)
Factory method which allows you to create a new
DashboardState object based on an existing
DashboardState. |
boolean |
equals(Object o) |
Iterable<? extends Iterable<GadgetState>> |
getColumns()
Deprecated.
|
DashboardColumns |
getDashboardColumns() |
Iterable<GadgetState> |
getGadgetsInColumn(DashboardState.ColumnIndex column)
Deprecated.
|
DashboardId |
getId()
Returns the unique identifier, represented by a
DashboardId, for the dashboard's state. |
Layout |
getLayout()
Returns the
Layout of the dashboard. |
String |
getTitle()
Returns the title of the dashboard.
|
long |
getVersion()
Returns this state's version so that it can be used by implementations when storing
DashboardStates, to
make sure the same object is stored and retrieved |
int |
hashCode() |
DashboardState |
prependGadgetToColumn(GadgetState dashboardItemState,
DashboardState.ColumnIndex index)
Deprecated.
|
DashboardState |
prependItemToColumn(DashboardItemState itemState,
DashboardState.ColumnIndex index)
Returns a new DashboardState built with the same data as
this, except that the column with index
index has had a new gadget added to its top |
String |
toString() |
public DashboardId getId()
DashboardId, for the dashboard's state.public String getTitle()
public Layout getLayout()
Layout of the dashboard.Layout of the dashboard@Deprecated public Iterable<GadgetState> getGadgetsInColumn(DashboardState.ColumnIndex column)
Iterable of the GadgetStates in the given column. They are
returned in the order that they appear on the dashboard from top to bottom.column - the index of the column to retrieve the GadgetStates forIterable of the GadgetState in the column
deprecated Use getDashboardColumns() instead. Since v3.11.@Deprecated public Iterable<? extends Iterable<GadgetState>> getColumns()
Iterable of the columns in this DashboardState (which contain the
GadgetStates).public DashboardColumns getDashboardColumns()
public long getVersion()
DashboardStates, to
make sure the same object is stored and retrieved@Deprecated public DashboardState prependGadgetToColumn(GadgetState dashboardItemState, DashboardState.ColumnIndex index)
prependItemToColumn(com.atlassian.gadgets.DashboardItemState, com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex) instead. Since v3.11.this, except that the column with index
index has had a new gadget added to its topdashboardItemState - the new gadget to addindex - the index of the column to add the new state to@Deprecated public DashboardState appendGadgetToColumn(GadgetState gadgetState, DashboardState.ColumnIndex index)
this, except that the column with index
index has had a new gadget added to its bottomgadgetState - the new gadget to addindex - the index of the column to add the new state toprependItemToColumn(com.atlassian.gadgets.DashboardItemState, com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex) instead. Since v3.11.public DashboardState prependItemToColumn(DashboardItemState itemState, DashboardState.ColumnIndex index)
this, except that the column with index
index has had a new gadget added to its topitemState - the new dashboard item to addindex - the index of the column to add the new state topublic DashboardState appendItemToColumn(DashboardItemState itemState, DashboardState.ColumnIndex index)
this, except that the column with index
index has had a new gadget added to its bottomitemState - the new dashboard item to addindex - the index of the column to add the new state topublic static DashboardState.Builder dashboard(DashboardState state)
DashboardState object based on an existing
DashboardState.state - the DashboardState to start with when building the new DashboardStateGadgetState.Builder which allows you to set the layout or change the columnspublic static DashboardState.TitleBuilder dashboard(DashboardId id)
DashboardState objects. It returns
a TitleBuilder which only allows you to set the title. After setting the title, a Builder will be
returned allowing other properties to be set.id - unique identifier for the new DashboardState objectTitleBuilder which can be used to set the title of the dashboardCopyright © 2024 Atlassian. All rights reserved.