healbesdk / com.healbe.healbesdk.business_api.healthdata / Container

Container

class Container<T>

A container object which may or may not contain a non-null value. If value is present, isEmpty() will return true and get() will return the value.

Functions

get

fun get(): T?

Returns item or null if container is empty.

isEmpty

fun isEmpty(): Boolean

Returns true if container has no value and false otherwise.

Companion Object Functions

empty

fun <T> empty(): Container<T>

Create empty container.

fromOptional

fun <T> fromOptional(item: T?): Container<T>

Create container with specified item or empty container if item is null.

wrap

fun <T> wrap(item: T): Container<T>

Create container with specified item.