Class Snippet

    • Constructor Detail

      • Snippet

        public Snippet()
        Creates an empty snippet
      • Snippet

        public Snippet​(String text)
        Creates a snippet with a specified body text. Title is automatically generated from the first 20 characters in the text, with ellipsis added if the length exceeds 20 characters.
        Parameters:
        text - body text, may contain HTML markup
      • Snippet

        public Snippet​(String title,
                       String text)
        Creates a snippet with a specified title and text. The title can be of arbitrary length. The body text may contain HTML markup.
        Parameters:
        title - title of the Snippet. May be of arbitrary length.
        text - body text, may contain HTML markup
    • Method Detail

      • getTitle

        public String getTitle()
        Get the set title text (either a user-specified string or up to 20 characters of the main snippet text.
        Returns:
        a string
      • getText

        public String getText()
        Get the snippet content text.
        Returns:
        a string