UnsafeWrapper


interface UnsafeWrapper

Known direct subclasses
ImagePlane
ImageWrapper

Wrapper interfaces that mirrors the primary read-only properties of android.media.Image.

Known indirect subclasses
AndroidImage.Plane

A Plane backed by an ImagePlane.

AndroidImage

ImageWrapper implementation that wraps an android.media.Image object.

FakeImagePlane

Fake implementation of ImagePlane for testing classes that consume camera image planes.

FakeImage

Fake implementation of MutableImageWrapper for testing.

MutableImageWrapper

A mutable extension of ImageWrapper that includes write properties.


An interface for wrapper objects that should not normally be accessed directly.

This interface indicates that an object or interface wraps a specific Android object or type and provides a way to retrieve the underlying object directly. Accessing the underlying objects can be useful for compatibility and testing, but is extremely risky if the state or lifetime of the object is managed by the library.

Summary

Public functions

T?
<T : Any> unwrapAs(type: Class<T>)

Attempt to unwrap this object into an underlying type.

Extension functions

inline T?

Attempts to unwrap this object into an underlying type.

Public functions

unwrapAs

Added in 1.7.0-alpha02
fun <T : Any> unwrapAs(type: Class<T>): T?

Attempt to unwrap this object into an underlying type.

This operation is not safe and should be used with caution as it makes no guarantees about the state of the underlying objects. In particular, implementations should assume that fakes, test wrappers will always return null. Finally this method should return null when unwrapping into the provided type is not supported.

Returns
T?

unwrapped object matching T or null

Extension functions

UnsafeWrapper.unwrapAs

inline fun <T : Any> UnsafeWrapper.unwrapAs(): T?

Attempts to unwrap this object into an underlying type.

See also
unwrapAs