UnsafeWrapper


public 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 methods

abstract T
<T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)

Attempt to unwrap this object into an underlying type.

Extension functions

default final T

Attempts to unwrap this object into an underlying type.

Public methods

unwrapAs

Added in 1.7.0-alpha02
abstract T <T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)

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

UnsafeWrapperKt.unwrapAs

default final T <T extends Object> UnsafeWrapperKt.unwrapAs(@NonNull UnsafeWrapper receiver)

Attempts to unwrap this object into an underlying type.

See also
unwrapAs