Option

abstract class Option<T : Any!>
kotlin.Any
   ↳ androidx.camera.core.impl.Config.Option

An Option is used to set and retrieve values for settings defined in a .

Options can be thought of as the key in a key/value pair that makes up a setting. As the name suggests, Options are optional, and may or may not exist inside a .

Summary

Public methods
open static Config.Option<T>
create(@NonNull id: String, @NonNull valueClass: Class<*>)

Creates an Option from an id and value class.

open static Config.Option<T>
create(@NonNull id: String, @NonNull valueClass: Class<*>, @Nullable token: Any?)

Creates an Option from an id, value class and token.

abstract String

Returns the unique string identifier for this option.

abstract Any?

Returns the optional type-erased context object for this option.

abstract Class<T>

Returns the class object associated with the value for this option.

Public methods

create

@NonNull open static fun <T : Any!> create(
    @NonNull id: String,
    @NonNull valueClass: Class<*>
): Config.Option<T>

Creates an Option from an id and value class.

Parameters
id String: A unique string identifier for this option. This generally follows the scheme <owner>.[optional.subCategories.]<optionId>.
valueClass Class<*>: The class of the value stored by this option.
<T> The type of the value stored by this option.
Return
Config.Option<T> An Option object which can be used to store/retrieve values from a .

create

@NonNull open static fun <T : Any!> create(
    @NonNull id: String,
    @NonNull valueClass: Class<*>,
    @Nullable token: Any?
): Config.Option<T>

Creates an Option from an id, value class and token.

Parameters
id String: A unique string identifier for this option. This generally follows the scheme <owner>.[optional.subCategories.]<optionId>.
valueClass Class<*>: The class of the value stored by this option.
<T> The type of the value stored by this option.
token Any?: An optional, type-erased object for storing more context for this specific option. Generally this object should have static scope and be immutable.
Return
Config.Option<T> An Option object which can be used to store/retrieve values from a .

getId

@NonNull abstract fun getId(): String

Returns the unique string identifier for this option.

This generally follows the scheme * <owner>.[optional.subCategories.]<optionId> .

Return
String The identifier.

getToken

@Nullable abstract fun getToken(): Any?

Returns the optional type-erased context object for this option.

Generally this object should have static scope and be immutable.

Return
Any? The type-erased context object.

getValueClass

@NonNull abstract fun getValueClass(): Class<T>

Returns the class object associated with the value for this option.

Return
Class<T> The class object for the value's type.