java.lang.Object | |
↳ | com.android.contacts.model.EntityDelta |
Contains an Entity and records any modifications separately so the original Entity can be swapped out with a newer version and the changes still cleanly applied.
One benefit of this approach is that we can build changes entirely on an empty Entity, which then becomes an insert RawContacts case.
When applying modifications over an Entity, we try finding the
original _ID
rows where the modifications took place. If those
rows are missing from the new Entity, we know the original data must
be deleted, but to preserve the user modifications we treat as an insert.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
EntityDelta.ValuesDelta | Type of ContentValues that maintains both an original state and a modified version of that state. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build a list of
ContentProviderOperation that will assert any
"before" state hasn't changed. | |||||||||||
Build a list of
ContentProviderOperation that will transform the
current "before" Entity state into the modified state which this
EntityDelta represents. | |||||||||||
Build an
EntityDelta using the given Entity as a
starting point; the "before" snapshot. | |||||||||||
Find entry with the given
_ID value. | |||||||||||
Return the total number of
EntityDelta.ValuesDelta contained. | |||||||||||
Get the
EntityDelta.ValuesDelta child marked as IS_PRIMARY ,
which may return null when no entry exists. | |||||||||||
Returns the super-primary entry for the given mime type
| |||||||||||
calls
getSuperPrimaryEntry(String, boolean) with true | |||||||||||
Mark this entire object deleted, including any
EntityDelta.ValuesDelta . | |||||||||||
Merge the "after" values from the given
EntityDelta onto the
"before" state represented by this EntityDelta , discarding any
existing "after" states. | |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build a
ContentProviderOperation that changes
AGGREGATION_MODE to the given value. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Build a list of ContentProviderOperation
that will assert any
"before" state hasn't changed. This is maintained separately so that all
asserts can take place before any updates occur.
Build a list of ContentProviderOperation
that will transform the
current "before" Entity state into the modified state which this
EntityDelta
represents.
Build an EntityDelta
using the given Entity as a
starting point; the "before" snapshot.
Return the total number of EntityDelta.ValuesDelta
contained.
Get the EntityDelta.ValuesDelta
child marked as IS_PRIMARY
,
which may return null when no entry exists.
Returns the super-primary entry for the given mime type
forceSelection | if true, will try to return some value even if a super-primary doesn't exist (may be a primary, or just a random item |
---|
calls getSuperPrimaryEntry(String, boolean)
with true
Merge the "after" values from the given EntityDelta
onto the
"before" state represented by this EntityDelta
, discarding any
existing "after" states. This is typically used when re-parenting changes
onto an updated Entity
.
Build a ContentProviderOperation
that changes
AGGREGATION_MODE
to the given value.