# 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 Summary

  Constructors
  Constructor
  Description
  `Builder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SharedContent.Builder`
  `addFile(String mime, String cn1Path, String title)`
  Adds a file item.
  `SharedContent.Builder`
  `addImage(String mime, String cn1Path, String title)`
  Adds an image item.
  `SharedContent.Builder`
  `addText(String text)`
  Adds a text item.
  `SharedContent.Builder`
  `addUrl(String url)`
  Adds a URL item.
  `SharedContent`
  `build()`
  Builds the immutable shared content.
  `SharedContent.Builder`
  `subject(String s)`
  Sets the subject.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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