Record Class LanguageInfo

java.lang.Object
java.lang.Record
smile.util.ipynb.LanguageInfo
Record Components:
name - the language name (e.g. "python", "scala").
version - the language version string (e.g. "3.10.4").
mimeType - the MIME type for the language (e.g. "text/x-python").
fileExtension - the standard file extension (e.g. ".py").
pygmentsLexer - the name of the Pygments lexer for syntax highlighting.
nbconvertExporter - the name of the nbconvert exporter for this language.
codemirrorMode - the CodeMirror mode — either a plain string or an object.
versionInfo - the language version broken into components as a list of integers (e.g. [3, 10, 4, "final", 0] for Python 3.10.4).

public record LanguageInfo(String name, String version, String mimeType, String fileExtension, String pygmentsLexer, String nbconvertExporter, tools.jackson.databind.JsonNode codemirrorMode, List<Object> versionInfo) extends Record
Information about the programming language of the kernel.

All fields are optional; only name is required by the spec. The codemirror_mode field may be either a plain string or an object (e.g. {"name":"ipython","version":3}) so it is modelled as JsonNode to handle both forms.

  • Constructor Details

    • LanguageInfo

      public LanguageInfo(String name, String version, String mimeType, String fileExtension, String pygmentsLexer, String nbconvertExporter, tools.jackson.databind.JsonNode codemirrorMode, List<Object> versionInfo)
      Creates an instance of a LanguageInfo record class.
      Parameters:
      name - the value for the name record component
      version - the value for the version record component
      mimeType - the value for the mimeType record component
      fileExtension - the value for the fileExtension record component
      pygmentsLexer - the value for the pygmentsLexer record component
      nbconvertExporter - the value for the nbconvertExporter record component
      codemirrorMode - the value for the codemirrorMode record component
      versionInfo - the value for the versionInfo 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.
    • name

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

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • mimeType

      public String mimeType()
      Returns the value of the mimeType record component.
      Returns:
      the value of the mimeType record component
    • fileExtension

      public String fileExtension()
      Returns the value of the fileExtension record component.
      Returns:
      the value of the fileExtension record component
    • pygmentsLexer

      public String pygmentsLexer()
      Returns the value of the pygmentsLexer record component.
      Returns:
      the value of the pygmentsLexer record component
    • nbconvertExporter

      public String nbconvertExporter()
      Returns the value of the nbconvertExporter record component.
      Returns:
      the value of the nbconvertExporter record component
    • codemirrorMode

      public tools.jackson.databind.JsonNode codemirrorMode()
      Returns the value of the codemirrorMode record component.
      Returns:
      the value of the codemirrorMode record component
    • versionInfo

      public List<Object> versionInfo()
      Returns the value of the versionInfo record component.
      Returns:
      the value of the versionInfo record component