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,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey for description of the application in HTML.static final StringKey for short description of the application in plain text.static final StringKey for the URL of a documentation web page.static final StringKey for the URL of an icon in png, gif or jpeg format.static final StringKey for application name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataasMetadata(Map map) Returns a given map as a Metadata object.voidcheck()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.voidsetDescriptionHtml(String html) Sets an HTML description of the application.voidsetDescriptionText(String txt) Sets a short description of the application.voidSets a URL for a documentation web page.voidsetIconUrl(String url) Sets a URL for a gif, png or jpeg icon identifying the application.voidSets the value for the application's name.Methods inherited from class org.astrogrid.samp.SampMap
checkHasKeys, entrySet, getList, getMap, getString, getUrl, putMethods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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_KEYkey
-
getName
Returns the value for the application's name.- Returns:
- value for
NAME_KEYkey
-
setDescriptionText
Sets a short description of the application.- Parameters:
txt- value forDESCTEXT_KEYkey
-
getDescriptionText
Returns a short description of the application.- Returns:
- value for
DESCTEXT_KEYkey
-
setDescriptionHtml
Sets an HTML description of the application.- Parameters:
html- value forDESCHTML_KEYkey
-
getDescriptionHtml
Returns an HTML description of the application.- Returns:
- value for
DESCHTML_KEYkey
-
setIconUrl
Sets a URL for a gif, png or jpeg icon identifying the application.- Parameters:
url- value forICONURL_KEYkey
-
getIconUrl
Returns a URL for a gif, png or jpeg icon identifying the application.- Returns:
- value for
ICONURL_KEYkey
-
setDocumentationUrl
Sets a URL for a documentation web page.- Parameters:
url- value forDOCURL_KEYkey
-
getDocumentationUrl
Returns a URL for a documentation web page.- Returns:
- value for
DOCURL_KEYkey
-
check
public void check()Description copied from class:SampMapChecks 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 informativeDataExceptionwill be thrown. -
asMetadata
Returns a given map as a Metadata object.- Parameters:
map- map- Returns:
- metadata
-