@Immutable public class GadgetState extends Object implements DashboardItemState, Serializable
An immutable extension of DashboardItemState. GadgetState state extends the DashboardItemState
with:
Map of the user preference valuesGadgetState objects should be built using the builders. At a minimum, the GadgetId
and spec URI are required.
By doing a static import of the gadget(GadgetId) method, you can
create a GadgetState object with:
GadgetState state = gadget(GadgetId.from(1000)).specUri("http://gadget/url").build();
Or you can build a new GadgetState object from an existing one with:
GadgetState state = gadget(originalState).color(color1).build();
GadgetState implements the Serializable marker interface. Serialization is only implemented so that
GadgetState objects may be distributed among remote systems that might be sharing a cache or need to
transfer GadgetStates for other reasons. Serialization is not meant to be used as a means of
persisting GadgetState objects between JVM restarts.
| Modifier and Type | Class and Description |
|---|---|
static class |
GadgetState.Builder
A builder that allows you to set the
Color and the user preferences of the GadgetState under
construction. |
static class |
GadgetState.SpecUriBuilder
A builder that allows you to set the spec URI of the gadget state under construction
|
| Modifier and Type | Method and Description |
|---|---|
<V> V |
accept(DashboardItemStateVisitor<V> visitor) |
boolean |
equals(Object o) |
static GadgetState.SpecUriBuilder |
gadget(GadgetId gadgetId)
Factory method to create a new builder which can be used to create
GadgetState objects. |
static GadgetState.Builder |
gadget(GadgetState state)
Factory method which allows you to create a new
GadgetState object based on an existing
GadgetState. |
Color |
getColor()
Returns the
Color scheme that should be used to decorate the chrome surrounding the gadget. |
URI |
getGadgetSpecUri()
Returns the
URI of the gadget spec, which defines the gadget as described in the
gadget spec reference. |
GadgetId |
getId()
Returns the unique identifier, represented by a
GadgetId, for the gadget's state. |
Map<String,String> |
getUserPrefs()
An immutable
Map of the user preference values for the gadget, keyed by the name of the user preference. |
int |
hashCode() |
String |
toString() |
public GadgetId getId()
GadgetId, for the gadget's state.getId in interface DashboardItemStatepublic URI getGadgetSpecUri()
URI of the gadget spec, which defines the gadget as described in the
gadget spec reference.URI of the gadget specpublic Color getColor()
Color scheme that should be used to decorate the chrome surrounding the gadget.getColor in interface DashboardItemStateColor scheme that should be used to decorate the chrome surrounding the gadgetpublic Map<String,String> getUserPrefs()
Map of the user preference values for the gadget, keyed by the name of the user preference.Map of the user preference values for the gadgetpublic <V> V accept(DashboardItemStateVisitor<V> visitor)
accept in interface DashboardItemStatepublic static GadgetState.Builder gadget(GadgetState state)
GadgetState object based on an existing
GadgetState.state - the GadgetState to start with when building the new GadgetStateBuilder which allows you to set the color or change the user preference valuespublic static GadgetState.SpecUriBuilder gadget(GadgetId gadgetId)
GadgetState objects. It returns
a SpecUriBuilder which allows you to set the location of the gadget spec.gadgetId - unique ID for the new GadgetState objectSpecUriBuilder which can be used to set the location of the gadget specCopyright © 2024 Atlassian. All rights reserved.