Entity
public
final
class
Entity
extends Object
A representation of a item using ContentValues. It contains one top level ContentValue
plus a collection of Uri, ContentValues tuples as subvalues. One example of its use
is in Contacts, where the top level ContentValue contains the columns from the RawContacts
table and the subvalues contain a ContentValues object for each row from the Data table that
corresponds to that RawContact. The uri refers to the Data table uri for each row.
Summary
Nested classes |
class |
Entity.NamedContentValues
|
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
Entity
public Entity (ContentValues values)
Parameters |
values |
ContentValues |
Public methods
addSubValue
public void addSubValue (Uri uri,
ContentValues values)
Parameters |
uri |
Uri |
values |
ContentValues |
toString
public String toString ()
Returns a string representation of the object.
Returns |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Entity\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Nested Classes](#nestedclasses) \\| [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nEntity\n======\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/content/Entity \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\nfinal\n\nclass\nEntity\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.content.Entity |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA representation of a item using ContentValues. It contains one top level ContentValue\nplus a collection of Uri, ContentValues tuples as subvalues. One example of its use\nis in Contacts, where the top level ContentValue contains the columns from the RawContacts\ntable and the subvalues contain a ContentValues object for each row from the Data table that\ncorresponds to that RawContact. The uri refers to the Data table uri for each row.\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|-----------------------------------------------------------------------------------|\n| ` class` | [Entity.NamedContentValues](/reference/android/content/Entity.NamedContentValues) |\n\n| ### Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[Entity](/reference/android/content/Entity#Entity(android.content.ContentValues))`(`[ContentValues](/reference/android/content/ContentValues)` values) ` |\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[addSubValue](/reference/android/content/Entity#addSubValue(android.net.Uri,%20android.content.ContentValues))`(`[Uri](/reference/android/net/Uri)` uri, `[ContentValues](/reference/android/content/ContentValues)` values) ` |\n| ` `[ContentValues](/reference/android/content/ContentValues) | ` `[getEntityValues](/reference/android/content/Entity#getEntityValues())`() ` |\n| ` `[ArrayList](/reference/java/util/ArrayList)`\u003c`[Entity.NamedContentValues](/reference/android/content/Entity.NamedContentValues)`\u003e` | ` `[getSubValues](/reference/android/content/Entity#getSubValues())`() ` |\n| ` `[String](/reference/java/lang/String) | ` `[toString](/reference/android/content/Entity#toString())`() ` Returns a string representation of the object. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final `[Class](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/reference/java/lang/Object#wait(long,%20int))`(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](/reference/java/lang/Object#wait(long))`(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](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic constructors\n-------------------\n\n### Entity\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Entity (ContentValues values)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|------------------------|\n| `values` | `ContentValues` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### addSubValue\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void addSubValue (Uri uri, \n ContentValues values)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|------------------------|\n| `uri` | `Uri` \u003cbr /\u003e |\n| `values` | `ContentValues` \u003cbr /\u003e |\n\n### getEntityValues\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic ContentValues getEntityValues ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------------------------------------------------------|--------|\n| [ContentValues](/reference/android/content/ContentValues) | \u003cbr /\u003e |\n\n### getSubValues\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic ArrayList\u003cEntity.NamedContentValues\u003e getSubValues ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------------------------------------------------------------------------------|--------|\n| [ArrayList](/reference/java/util/ArrayList)`\u003c`[Entity.NamedContentValues](/reference/android/content/Entity.NamedContentValues)`\u003e` | \u003cbr /\u003e |\n\n### toString\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic String toString ()\n```\n\nReturns a string representation of the object.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|-----------------------------------------------|\n| [String](/reference/java/lang/String) | a string representation of the object. \u003cbr /\u003e |"]]