value public final class CameraId


A type-safe identifier for a camera device.

This value class wraps a String representation of a camera ID. Using CameraId instead of raw strings or integers helps prevent type confusion and ensures that APIs receiving or returning camera identifiers are self-documenting and type-safe.

CameraId instances are typically created using the factory methods in the companion object: fromCamera2Id for Camera2 string identifiers, or fromCamera1Id for legacy Camera1 integer identifiers.

Summary

Nested types

public static class CameraId.Companion

Public constructors

Public methods

final @NonNull String

The underlying string representation of the camera identifier.

@NonNull String

Returns a string representation of the CameraId for debugging purposes, in the format "CameraId-value".

Public constructors

CameraId

Added in 1.7.0-alpha03
public CameraId(@NonNull String value)

Public methods

getValue

Added in 1.7.0-alpha03
public final @NonNull String getValue()

The underlying string representation of the camera identifier. Must not be empty.

toString

public @NonNull String toString()

Returns a string representation of the CameraId for debugging purposes, in the format "CameraId-value".