PartKt

public final classPartKt


Summary

Public methods

static finalFileDataPart

Returns the part as aFileDataPart if it represents a file, and null otherwise

static finalBitmap

Returns the part as aBitmap if it represents an image, and null otherwise

static finalInlineDataPart

Returns the part as aInlineDataPart if it represents inline data, and null otherwise

static finalString

Returns the part as aString if it represents text, and null otherwise

Public methods

PartKt.asFileDataOrNull

public static final FileDataPart PartKt.asFileDataOrNull(@NonNullPart receiver)

Returns the part as aFileDataPart if it represents a file, and null otherwise

PartKt.asImageOrNull

public static final Bitmap PartKt.asImageOrNull(@NonNullPart receiver)

Returns the part as aBitmap if it represents an image, and null otherwise

PartKt.asInlineDataPartOrNull

public static final InlineDataPart PartKt.asInlineDataPartOrNull(@NonNullPart receiver)

Returns the part as aInlineDataPart if it represents inline data, and null otherwise

PartKt.asTextOrNull

public static final String PartKt.asTextOrNull(@NonNullPart receiver)

Returns the part as aString if it represents text, and null otherwise

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.