Class AbstractContext

All Implemented Interfaces:
Direct Known Subclasses:
CoreContext, ErrorContext, ProtostellarContext, RangeScanContext, WaitUntilReadyContext

public abstract class AbstractContext extends Object implements Context
Common parent method for all contexts.

Contexts are encouraged to derive from this abstract class because all they have to do then is to implement/override injectExportableParams(Map) and feed the data they want to be extracted. The actual extraction and formatting then comes for free.

  • Constructor Details

    • AbstractContext

      public AbstractContext()
  • Method Details

    • injectExportableParams

      public void injectExportableParams(Map<String,Object> input)
      This method needs to be implemented by the actual context implementations to inject the params they need for exporting.
      input - pass exportable params in here.
    • exportAsString

      public String exportAsString(Context.ExportFormat format)
      Description copied from interface: Context
      Export this context into the specified format.
      Specified by:
      exportAsString in interface Context
      format - the format to export into.
      the exported format as a string representation.
    • exportAsMap

      public Map<String,Object> exportAsMap()
      Description copied from interface: Context
      Export this context into a generic map.
      Specified by:
      exportAsMap in interface Context
      the exported format in a generic map representation.
    • toString

      public String toString()
      toString in class Object