Record Class CellMetadata

java.lang.Object
java.lang.Record
smile.util.ipynb.CellMetadata
Record Components:
collapsed - whether the cell output is collapsed (null if unset). Deprecated in nbformat 5; use jupyter.outputs_hidden.
scrolled - whether the cell output is scrolled — can be true, false, or the string "auto". Deprecated in nbformat 5; use jupyter.outputs_hidden.
deletable - whether the cell is deletable from the UI.
editable - whether the cell is editable.
format - the MIME type for raw cells (legacy; prefer raw_mimetype).
rawMimetype - the MIME type indicating the target format for a raw cell (e.g. "text/restructuredtext"). This is the nbformat 5 replacement for format.
name - an optional name for the cell used by tools.
tags - a list of string tags for the cell.
jupyter - sub-object for Jupyter front-end specific metadata, including source_hidden and outputs_hidden.
execution - cell-level execution timing metadata.

public record CellMetadata(Boolean collapsed, Object scrolled, Boolean deletable, Boolean editable, String format, String rawMimetype, String name, List<String> tags, Map<String,Object> jupyter, Map<String,Object> execution) extends Record
Cell-level metadata. All fields are optional; unknown metadata keys are preserved in the collapsed, scrolled, and tags fields where applicable, and any additional properties should be round-tripped transparently when using JsonAnySetter / JsonAnyGetter on richer implementations.

In nbformat 5, collapsed and scrolled are deprecated at the cell level; the replacements are jupyter.outputs_hidden and jupyter.source_hidden inside the jupyter sub-object.

  • Constructor Details

    • CellMetadata

      public CellMetadata()
      Constructs a CellMetadata with all fields set to null.
    • CellMetadata

      public CellMetadata(Boolean collapsed, Object scrolled, Boolean deletable, Boolean editable, String format, String rawMimetype, String name, List<String> tags, Map<String,Object> jupyter, Map<String,Object> execution)
      Creates an instance of a CellMetadata record class.
      Parameters:
      collapsed - the value for the collapsed record component
      scrolled - the value for the scrolled record component
      deletable - the value for the deletable record component
      editable - the value for the editable record component
      format - the value for the format record component
      rawMimetype - the value for the rawMimetype record component
      name - the value for the name record component
      tags - the value for the tags record component
      jupyter - the value for the jupyter record component
      execution - the value for the execution record component
  • Method Details

    • 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.
    • collapsed

      public Boolean collapsed()
      Returns the value of the collapsed record component.
      Returns:
      the value of the collapsed record component
    • scrolled

      public Object scrolled()
      Returns the value of the scrolled record component.
      Returns:
      the value of the scrolled record component
    • deletable

      public Boolean deletable()
      Returns the value of the deletable record component.
      Returns:
      the value of the deletable record component
    • editable

      public Boolean editable()
      Returns the value of the editable record component.
      Returns:
      the value of the editable record component
    • format

      public String format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • rawMimetype

      public String rawMimetype()
      Returns the value of the rawMimetype record component.
      Returns:
      the value of the rawMimetype record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • tags

      public List<String> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • jupyter

      public Map<String,Object> jupyter()
      Returns the value of the jupyter record component.
      Returns:
      the value of the jupyter record component
    • execution

      public Map<String,Object> execution()
      Returns the value of the execution record component.
      Returns:
      the value of the execution record component