public static class CameraMetadataNative.Key<T> extends Object
Constructor and Description |
---|
Key(String name,
Class<T> type)
Visible for testing only.
|
Key(String name,
TypeReference<T> typeReference)
Visible for testing only.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compare this key against other native keys, request keys, result keys, and
characteristics keys.
|
String |
getName()
Return a camelCase, period separated name formatted like:
"root.section[.subsections].name" . |
int |
getTag()
Get the tag corresponding to this key.
|
Class<T> |
getType()
Get the raw class backing the type
T for this key. |
TypeReference<T> |
getTypeReference()
Get the type reference backing the type
T for this key. |
int |
hashCode()
Returns a hash code value for the object.
|
public Key(String name, Class<T> type)
Use the CameraCharacteristics.Key, CaptureResult.Key, or CaptureRequest.Key for application code or vendor-extended keys.
public Key(String name, TypeReference<T> typeReference)
Use the CameraCharacteristics.Key, CaptureResult.Key, or CaptureRequest.Key for application code or vendor-extended keys.
public final String getName()
"root.section[.subsections].name"
.
Built-in keys exposed by the Android SDK are always prefixed with "android."
;
keys that are device/platform-specific are prefixed with "com."
.
For example, CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP
would
have a name of "android.scaler.streamConfigurationMap"
; whereas a device
specific key might look like "com.google.nexus.data.private"
.
public final int hashCode()
HashMap
.
The general contract of hashCode
is:
hashCode
method
must consistently return the same integer, provided no information
used in equals
comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode
method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
JavaTM programming language.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public final boolean equals(Object o)
Two keys are considered equal if their name and type reference are equal.
Note that the equality against non-native keys is one-way. A native key may be equal to a result key; but that same result key will not be equal to a native key.
equals
in class Object
o
- the reference object with which to compare.true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
public final int getTag()
Get the tag corresponding to this key. This enables insertion into the native metadata.
This value is looked up the first time, and cached subsequently.
public final Class<T> getType()
T
for this key.
The distinction is only important if T
is a generic, e.g.
Range<Integer>
since the nested type will be erased.
public final TypeReference<T> getTypeReference()
T
for this key.
The distinction is only important if T
is a generic, e.g.
Range<Integer>
since the nested type will be retained.