public
static
final
class
Metadata.Builder
extends Object
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
Builder
public Builder ()
Public methods
setClientRecordId
public Metadata.Builder setClientRecordId (String clientRecordId)
Sets optional client supplied record unique data identifier associated with the data.
There is guaranteed a single entry for any type of data with same client provided
identifier for a given client. Any new insertions with the same client provided
identifier will either replace or be ignored depending on associated clientRecordVersion
. @see clientRecordVersion
A null value means that no clientRecordId is set
Parameters |
clientRecordId |
String : This value may be null . |
setClientRecordVersion
public Metadata.Builder setClientRecordVersion (long clientRecordVersion)
Sets optional client supplied version associated with the data. This determines conflict
resolution outcome when there are multiple insertions of the same clientRecordId
.
Data with the highest clientRecordVersion
takes precedence. clientRecordVersion
starts with 0. @see clientRecordId
Parameters |
clientRecordVersion |
long |
setDataOrigin
public Metadata.Builder setDataOrigin (DataOrigin dataOrigin)
Sets where the data comes from, such as application information originally generated this
data. When Record
is created before insertion, this contains a sentinel value,
any assigned value will be ignored. After insertion, this will be populated with inserted
application.
Parameters |
dataOrigin |
DataOrigin : This value cannot be null . |
setDevice
public Metadata.Builder setDevice (Device device)
Sets optional client supplied device information associated with the data.
Parameters |
device |
Device : This value cannot be null . |
setId
public Metadata.Builder setId (String id)
Sets unique identifier of this data, assigned by the Android Health Platform at insertion
time. When Record
is created before insertion, this takes a sentinel value, any
assigned value will be ignored.
Parameters |
id |
String : This value cannot be null . |
setLastModifiedTime
public Metadata.Builder setLastModifiedTime (Instant lastModifiedTime)
Sets when data was last modified (or originally created). When Record
is created
before inserted, this contains a sentinel value, any assigned value will be ignored.
Parameters |
lastModifiedTime |
Instant : This value cannot be null . |
setRecordingMethod
public Metadata.Builder setRecordingMethod (int recordingMethod)
Sets recording method for the Record
. This detail helps to know how the data was
recorded which can be useful for prioritization of the record