Class Snippet

java.lang.Object
io.cucumber.messages.types.Snippet

public final class Snippet extends Object
Represents the Snippet message in Cucumber's message protocol
  • Constructor Details

  • Method Details

    • getLanguage

      public String getLanguage()
      The programming language of the code.

      This must be formatted as an all lowercase identifier such that syntax highlighters like [Prism](https://prismjs.com/#supported-languages) or [Highlight.js](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) can recognize it. For example: `cpp`, `cs`, `go`, `java`, `javascript`, `php`, `python`, `ruby`, `scala`.

    • getCode

      public String getCode()
      A snippet of code
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object