Content.Builder

class Content.Builder


Builder for Content.

Summary

Public constructors

Public functions

Content.Builder

Adds a Part to the content.

Content
Content.Builder

Convenience method to add an ImagePart.

Content.Builder
parts(vararg part: Part)

Adds multiple Part objects to the content.

Content.Builder

Sets the Role for the content.

Content.Builder

Sets the Role for the content.

Content.Builder

Convenience method to add a TextPart.

Public properties

Int

Public constructors

Builder

Builder()

Public functions

addPart

@CanIgnoreReturnValue
fun addPart(part: Part): Content.Builder

Adds a Part to the content.

build

fun build(): Content

image

@CanIgnoreReturnValue
fun image(bitmap: Bitmap): Content.Builder

Convenience method to add an ImagePart.

parts

fun parts(vararg part: Part): Content.Builder

Adds multiple Part objects to the content.

role

@CanIgnoreReturnValue
fun role(@Content.Role role: Int): Content.Builder

Sets the Role for the content.

setRole

@CanIgnoreReturnValue
fun setRole(@Content.Role role: Int): Content.Builder

Sets the Role for the content.

text

@CanIgnoreReturnValue
fun text(text: String): Content.Builder

Convenience method to add a TextPart.

Public properties

role

@Content.Role
var role: Int