Class PluginInfo.Builder

java.lang.Object
org.hansken.plugin.extraction.api.PluginInfo.Builder
Enclosing class:
PluginInfo

public static final class PluginInfo.Builder extends Object
A builder for plugin information.

Note: all methods throw a NullPointerException when null is passed to them.

  • Method Details

    • name

      Deprecated.
      Use id(PluginId) instead.
      Set the name of this plugin.
      Parameters:
      name - the name
      Returns:
      this
      Throws:
      IllegalArgumentException - if the name is empty
    • pluginVersion

      public PluginInfo.Builder pluginVersion(String version)
      Parameters:
      version - the plugin version
      Returns:
      this
      Throws:
      IllegalArgumentException - if the version is empty
    • description

      public PluginInfo.Builder description(String description)
      Set the description.
      Parameters:
      description - the description
      Returns:
      this
      Throws:
      IllegalArgumentException - if the description is empty
    • author

      public PluginInfo.Builder author(Author author)
      Set the author.
      Parameters:
      author - the author
      Returns:
      this
    • maturityLevel

      public PluginInfo.Builder maturityLevel(MaturityLevel maturityLevel)
      Parameters:
      maturityLevel - the maturity level
      Returns:
      this
    • hqlMatcher

      public PluginInfo.Builder hqlMatcher(String hqlMatcher)
      Set the hqlMatcher query in string format.
      Parameters:
      hqlMatcher - the matcher
      Returns:
      this
    • webpageUrl

      public PluginInfo.Builder webpageUrl(String webpageUrl)
      Set the url to a webpage that belongs to this plugin. This can also be a link to a webpage of the git repository of the remote plugin.
      Parameters:
      webpageUrl - url to webpage
      Returns:
      this
    • deferredIterations

      public PluginInfo.Builder deferredIterations(int deferredIterations)
      Set the number of extraction iterations needed for this deferred plugin. Only relevant for deferred plugins. If this method is not called upon, default number of iterations will be set to 1.
      Parameters:
      deferredIterations - number of iterations needed for this plugin. Should be between 1 and 20
      Returns:
      this
    • id

      public PluginInfo.Builder id(String domain, String category, String name)
      Set the unique id of this plugin, consisting of domain, category and name.

      example: "nfi.nl/extract/ocr/detection/plugin".
      in this example nfi.nl is the domain, extract is the category, and ocr/detection/plugin is the name.

      Parameters:
      domain - the domain of the organisation, for example "nfi.nl"
      category - the action group of the plugin, for example `extract`, `carve`, `classify` (read the SDK documentation for more details).
      name - the name of the plugin, or in the classic sense, a description detailing the action(s) of the plugin. Note that the name can contain (forward) slashes.
      Returns:
      this
    • id

      public PluginInfo.Builder id(PluginId id)
      Set the unique id of this plugin, consisting of domain, category and name.
      Parameters:
      id - the unique id of this plugin, consisting of domain, category and name.
      Returns:
      this
    • license

      public PluginInfo.Builder license(String license)
      Set the name of the license of this plugin.
      Parameters:
      license - name of the license of the plugin
      Returns:
      this
    • resources

      public PluginInfo.Builder resources(PluginResources resources)
      Set the resources of this plugin (optional).
      Parameters:
      resources - the resources of this plugin
      Returns:
      this
    • transformer

      public PluginInfo.Builder transformer(List<TransformerLabel> transformers)
    • build

      public PluginInfo build()
      Create the plugin information from the properties set on this builder.
      Returns:
      the created plugin information