public interface MarshalQueryable<T>
Not all queryable instances will support exactly one combination. Some, such as the primitive queryable will support all primitive to/from managed mappings (as long as they are 1:1). Others, such as the rectangle queryable will only support integer to rectangle mappings.
Yet some others are codependent on other queryables; e.g. array queryables might only support
a type map for T[]
if another queryable exists with support for the component type
T
.
Modifier and Type | Method and Description |
---|---|
Marshaler<T> |
createMarshaler(TypeReference<T> managedType,
int nativeType)
Create a marshaler between the selected managed and native type.
|
boolean |
isTypeMappingSupported(TypeReference<T> managedType,
int nativeType)
Determine whether or not this query marshal is able to create a marshaler that will
support the managed type and native type mapping.
|
Marshaler<T> createMarshaler(TypeReference<T> managedType, int nativeType)
This marshaler instance is only good for that specific type mapping; and will refuse to map other managed types, other native types, or an other combination that isn't this exact one.
managedType
- a managed type referencenativeType
- the native type, e.g.
TYPE_BYTE
UnsupportedOperationException
- if isTypeMappingSupported(android.hardware.camera2.utils.TypeReference<T>, int)
returns false
boolean isTypeMappingSupported(TypeReference<T> managedType, int nativeType)
If this returns true
, then a marshaler can be instantiated by
createMarshaler(android.hardware.camera2.utils.TypeReference<T>, int)
that will marshal data to/from the native type
from/to the managed type.
Most marshalers are likely to only support one type map.