Package org.astrogrid.samp
Class Metadata
java.lang.Object
java.util.AbstractMap
org.astrogrid.samp.SampMap
org.astrogrid.samp.Metadata
- All Implemented Interfaces:
Map
Represents the application metadata associated with a SAMP client.
- Since:
- 14 Jul 2008
- Author:
- Mark Taylor
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Key for description of the application in HTML.static final String
Key for short description of the application in plain text.static final String
Key for the URL of a documentation web page.static final String
Key for the URL of an icon in png, gif or jpeg format.static final String
Key for application name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Metadata
asMetadata
(Map map) Returns a given map as a Metadata object.void
check()
Checks that this object is ready for use with the SAMP toolkit.Returns an HTML description of the application.Returns a short description of the application.Returns a URL for a documentation web page.Returns a URL for a gif, png or jpeg icon identifying the application.getName()
Returns the value for the application's name.void
setDescriptionHtml
(String html) Sets an HTML description of the application.void
setDescriptionText
(String txt) Sets a short description of the application.void
Sets a URL for a documentation web page.void
setIconUrl
(String url) Sets a URL for a gif, png or jpeg icon identifying the application.void
Sets the value for the application's name.Methods inherited from class org.astrogrid.samp.SampMap
checkHasKeys, entrySet, getList, getMap, getString, getUrl, put
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
NAME_KEY
Key for application name.- See Also:
-
DESCTEXT_KEY
Key for short description of the application in plain text.- See Also:
-
DESCHTML_KEY
Key for description of the application in HTML.- See Also:
-
ICONURL_KEY
Key for the URL of an icon in png, gif or jpeg format.- See Also:
-
DOCURL_KEY
Key for the URL of a documentation web page.- See Also:
-
-
Constructor Details
-
Metadata
public Metadata()Constructs an empty Metadata map. -
Metadata
Constructs a Metadata map based on a given map.- Parameters:
map
- map containing initial values for this object
-
-
Method Details
-
setName
Sets the value for the application's name.- Parameters:
name
- value forNAME_KEY
key
-
getName
Returns the value for the application's name.- Returns:
- value for
NAME_KEY
key
-
setDescriptionText
Sets a short description of the application.- Parameters:
txt
- value forDESCTEXT_KEY
key
-
getDescriptionText
Returns a short description of the application.- Returns:
- value for
DESCTEXT_KEY
key
-
setDescriptionHtml
Sets an HTML description of the application.- Parameters:
html
- value forDESCHTML_KEY
key
-
getDescriptionHtml
Returns an HTML description of the application.- Returns:
- value for
DESCHTML_KEY
key
-
setIconUrl
Sets a URL for a gif, png or jpeg icon identifying the application.- Parameters:
url
- value forICONURL_KEY
key
-
getIconUrl
Returns a URL for a gif, png or jpeg icon identifying the application.- Returns:
- value for
ICONURL_KEY
key
-
setDocumentationUrl
Sets a URL for a documentation web page.- Parameters:
url
- value forDOCURL_KEY
key
-
getDocumentationUrl
Returns a URL for a documentation web page.- Returns:
- value for
DOCURL_KEY
key
-
check
public void check()Description copied from class:SampMap
Checks that this object is ready for use with the SAMP toolkit. As well as callingSampUtils.checkMap(java.util.Map)
(ensuring that all keys are Strings, and all values Strings, Lists or Maps), subclass-specific invariants may be checked. In the case that there's something wrong, an informativeDataException
will be thrown. -
asMetadata
Returns a given map as a Metadata object.- Parameters:
map
- map- Returns:
- metadata
-