Class Metadata

All Implemented Interfaces:
Map

public class Metadata extends SampMap
Represents the application metadata associated with a SAMP client.
Since:
14 Jul 2008
Author:
Mark Taylor
  • Field Details

  • Constructor Details

    • Metadata

      public Metadata()
      Constructs an empty Metadata map.
    • Metadata

      public Metadata(Map map)
      Constructs a Metadata map based on a given map.
      Parameters:
      map - map containing initial values for this object
  • Method Details

    • setName

      public void setName(String name)
      Sets the value for the application's name.
      Parameters:
      name - value for NAME_KEY key
    • getName

      public String getName()
      Returns the value for the application's name.
      Returns:
      value for NAME_KEY key
    • setDescriptionText

      public void setDescriptionText(String txt)
      Sets a short description of the application.
      Parameters:
      txt - value for DESCTEXT_KEY key
    • getDescriptionText

      public String getDescriptionText()
      Returns a short description of the application.
      Returns:
      value for DESCTEXT_KEY key
    • setDescriptionHtml

      public void setDescriptionHtml(String html)
      Sets an HTML description of the application.
      Parameters:
      html - value for DESCHTML_KEY key
    • getDescriptionHtml

      public String getDescriptionHtml()
      Returns an HTML description of the application.
      Returns:
      value for DESCHTML_KEY key
    • setIconUrl

      public void setIconUrl(String url)
      Sets a URL for a gif, png or jpeg icon identifying the application.
      Parameters:
      url - value for ICONURL_KEY key
    • getIconUrl

      public URL getIconUrl()
      Returns a URL for a gif, png or jpeg icon identifying the application.
      Returns:
      value for ICONURL_KEY key
    • setDocumentationUrl

      public void setDocumentationUrl(String url)
      Sets a URL for a documentation web page.
      Parameters:
      url - value for DOCURL_KEY key
    • getDocumentationUrl

      public URL 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 calling SampUtils.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 informative DataException will be thrown.
      Overrides:
      check in class SampMap
    • asMetadata

      public static Metadata asMetadata(Map map)
      Returns a given map as a Metadata object.
      Parameters:
      map - map
      Returns:
      metadata