|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.gadgets.GadgetState
@Immutable public final class GadgetState
An immutable representation of a gadget. A gadget's state consists of
GadgetId, used to uniquely identify the gadget within the systemColor, used in the gadget's chromeMap 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.
| Nested Class Summary | |
|---|---|
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 |
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public GadgetId getId()
GadgetId, for the gadget's state.
public 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.
Color 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 boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic static GadgetState.Builder gadget(GadgetState state)
GadgetState object based on an existing
GadgetState.
state - the GadgetState to start with when building the new GadgetState
Builder 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 object
SpecUriBuilder which can be used to set the location of the gadget spec
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||