Record Class DisplayDataOutput

java.lang.Object
java.lang.Record
smile.util.ipynb.DisplayDataOutput
Record Components:
data - the MIME-bundle mapping MIME types to their content.
metadata - optional MIME-type-specific metadata.
transientData - transient data not saved with the notebook (e.g. display ids).
All Implemented Interfaces:
Output

public record DisplayDataOutput(Map<String, tools.jackson.databind.JsonNode> data, Map<String, tools.jackson.databind.JsonNode> metadata, Map<String, tools.jackson.databind.JsonNode> transientData) extends Record implements Output
A rich display-data output (output type "display_data").

The data map is keyed by MIME type (e.g. "text/plain", "text/html", "image/png") and the value is either a string or an array of strings for multiline text, or a base64-encoded string for binary formats such as images. The optional metadata map may carry MIME-type-specific metadata (e.g. image dimensions).

  • Constructor Details

    • DisplayDataOutput

      public DisplayDataOutput(Map<String, tools.jackson.databind.JsonNode> data, Map<String, tools.jackson.databind.JsonNode> metadata, Map<String, tools.jackson.databind.JsonNode> transientData)
      Creates an instance of a DisplayDataOutput record class.
      Parameters:
      data - the value for the data record component
      metadata - the value for the metadata record component
      transientData - the value for the transientData record component
  • Method Details

    • outputType

      public String outputType()
      Description copied from interface: Output
      Returns the output type identifier.
      Specified by:
      outputType in interface Output
      Returns:
      one of "stream", "display_data", "execute_result", or "error".
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • data

      public Map<String, tools.jackson.databind.JsonNode> data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component
    • metadata

      public Map<String, tools.jackson.databind.JsonNode> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • transientData

      public Map<String, tools.jackson.databind.JsonNode> transientData()
      Returns the value of the transientData record component.
      Returns:
      the value of the transientData record component