[android-components](../../index.md) / [mozilla.components.support.base.utils](../index.md) / [SharedPreferencesCache](index.md) / [toJSON](./to-j-s-o-n.md)

# toJSON

`abstract fun `[`T`](index.md#T)`.toJSON(): <ERROR CLASS>` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/base/src/main/java/mozilla/components/support/base/utils/SharedPreferencesCache.kt#L35)

A conversion method from [T](index.md#T) into a [JSONObject](#).

