Class SharedContent.Builder

java.lang.Object
com.codename1.share.SharedContent.Builder
Enclosing class:
SharedContent

public static final class SharedContent.Builder extends Object
Builder for SharedContent. Used by the platform ports.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • subject

      public SharedContent.Builder subject(String s)

      Sets the subject.

      Parameters
      • s: the subject
      Returns

      this builder for chaining

    • addText

      public SharedContent.Builder addText(String text)

      Adds a text item.

      Parameters
      • text: the text
      Returns

      this builder for chaining

    • addUrl

      public SharedContent.Builder addUrl(String url)

      Adds a URL item.

      Parameters
      • url: the URL
      Returns

      this builder for chaining

    • addFile

      public SharedContent.Builder addFile(String mime, String cn1Path, String title)

      Adds a file item.

      Parameters
      • mime: the MIME type, or null

      • cn1Path: the FileSystemStorage path of the copied file

      • title: an optional title, or null

      Returns

      this builder for chaining

    • addImage

      public SharedContent.Builder addImage(String mime, String cn1Path, String title)

      Adds an image item.

      Parameters
      • mime: the MIME type, or null

      • cn1Path: the FileSystemStorage path of the copied image

      • title: an optional title, or null

      Returns

      this builder for chaining

    • build

      public SharedContent build()

      Builds the immutable shared content.

      Returns

      the shared content