public class ParseObject extends Object
ParseObject
is a local representation of data that can be saved and retrieved from
the Parse cloud.
The basic workflow for creating new data is to construct a new ParseObject
, use
ParseObject.put(String, Object)
to fill it with data, and then use ParseObject.saveInBackground()
to
persist to the cloud.
The basic workflow for accessing existing data is to use a ParseQuery
to specify which
existing data to retrieve.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PIN
Default name for pinning if not specified.
|
Modifier | Constructor and Description |
---|---|
protected |
ParseObject()
The base class constructor to call in subclasses.
|
|
ParseObject(String theClassName)
Constructs a new
ParseObject with no data in it. |
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
Object value)
Atomically adds an object to the end of the array associated with a given key.
|
void |
addAll(String key,
Collection<?> values)
Atomically adds the objects contained in a
Collection to the end of the array
associated with a given key. |
void |
addAllUnique(String key,
Collection<?> values)
Atomically adds the objects contained in a
Collection to the array associated with a
given key, only adding elements which are not already present in the array. |
void |
addUnique(String key,
Object value)
Atomically adds an object to the array associated with a given key, only if it is not already
present in the array.
|
boolean |
containsKey(String key)
Whether this object has a particular key.
|
static <T extends ParseObject> |
create(Class<T> subclass)
Creates a new
ParseObject based upon a subclass type. |
static ParseObject |
create(String className)
Creates a new
ParseObject based upon a class name. |
static <T extends ParseObject> |
createWithoutData(Class<T> subclass,
String objectId)
Creates a reference to an existing
ParseObject for use in creating associations between
ParseObject s. |
static ParseObject |
createWithoutData(String className,
String objectId)
Creates a reference to an existing
ParseObject for use in creating associations between
ParseObject s. |
void |
delete()
Deletes this object on the server.
|
static <T extends ParseObject> |
deleteAll(List<T> objects)
Deletes each object in the provided list.
|
static <T extends ParseObject> |
deleteAllInBackground(List<T> objects)
Deletes each object in the provided list.
|
static <T extends ParseObject> |
deleteAllInBackground(List<T> objects,
DeleteCallback callback)
Deletes each object in the provided list.
|
Task<Void> |
deleteEventually()
Deletes this object from the server at some unspecified time in the future, even if Parse is
currently inaccessible.
|
void |
deleteEventually(DeleteCallback callback)
Deletes this object from the server at some unspecified time in the future, even if Parse is
currently inaccessible.
|
Task<Void> |
deleteInBackground()
Deletes this object on the server in a background thread.
|
void |
deleteInBackground(DeleteCallback callback)
Deletes this object on the server in a background thread.
|
<T extends ParseObject> |
fetch()
Fetches this object with the data from the server.
|
static <T extends ParseObject> |
fetchAll(List<T> objects)
Fetches all the objects in the provided list.
|
static <T extends ParseObject> |
fetchAllIfNeeded(List<T> objects)
Fetches all the objects that don't have data in the provided list.
|
static <T extends ParseObject> |
fetchAllIfNeededInBackground(List<T> objects)
Fetches all the objects that don't have data in the provided list in the background.
|
static <T extends ParseObject> |
fetchAllIfNeededInBackground(List<T> objects,
FindCallback<T> callback)
Fetches all the objects that don't have data in the provided list in the background.
|
static <T extends ParseObject> |
fetchAllInBackground(List<T> objects)
Fetches all the objects in the provided list in the background.
|
static <T extends ParseObject> |
fetchAllInBackground(List<T> objects,
FindCallback<T> callback)
Fetches all the objects in the provided list in the background.
|
void |
fetchFromLocalDatastore()
Loads data from the local datastore into this object, if it has not been fetched from the
server already.
|
<T extends ParseObject> |
fetchFromLocalDatastoreInBackground(GetCallback<T> callback)
Loads data from the local datastore into this object, if it has not been fetched from the
server already.
|
<T extends ParseObject> |
fetchIfNeeded()
If this
ParseObject has not been fetched (i.e. |
<T extends ParseObject> |
fetchIfNeededInBackground()
If this
ParseObject has not been fetched (i.e. |
<T extends ParseObject> |
fetchIfNeededInBackground(GetCallback<T> callback)
If this
ParseObject has not been fetched (i.e. |
<T extends ParseObject> |
fetchInBackground()
Fetches this object with the data from the server in a background thread.
|
<T extends ParseObject> |
fetchInBackground(GetCallback<T> callback)
Fetches this object with the data from the server in a background thread.
|
Object |
get(String key)
Access a value.
|
ParseACL |
getACL()
Access the
ParseACL governing this object. |
boolean |
getBoolean(String key)
Access a
boolean value. |
byte[] |
getBytes(String key)
Access a
byte[] value. |
String |
getClassName()
Accessor to the class name.
|
Date |
getCreatedAt()
This reports time as the server sees it, so that if you create a
ParseObject , then wait a
while, and then call ParseObject.save() , the creation time will be the time of the first
ParseObject.save() call rather than the time the object was created locally. |
Date |
getDate(String key)
Access a
Date value. |
double |
getDouble(String key)
Access a
double value. |
int |
getInt(String key)
Access an
int value. |
JSONArray |
getJSONArray(String key)
Access a
JSONArray value. |
JSONObject |
getJSONObject(String key)
Access a
JSONObject value. |
<T> List<T> |
getList(String key)
Access a
List value. |
long |
getLong(String key)
Access a
long value. |
<V> Map<String,V> |
getMap(String key)
Access a
Map value |
Number |
getNumber(String key)
Access a
Number value. |
String |
getObjectId()
Accessor to the object id.
|
ParseFile |
getParseFile(String key)
Access a
ParseFile value. |
ParseGeoPoint |
getParseGeoPoint(String key)
Access a
ParseGeoPoint value. |
ParseObject |
getParseObject(String key)
Access a
ParseObject value. |
ParseUser |
getParseUser(String key)
Access a
ParseUser value. |
<T extends ParseObject> |
getRelation(String key)
Access or create a
ParseRelation value for a key |
String |
getString(String key)
Access a
String value. |
Date |
getUpdatedAt()
This reports time as the server sees it, so that if you make changes to a
ParseObject , then
wait a while, and then call ParseObject.save() , the updated time will be the time of the
ParseObject.save() call rather than the time the object was changed locally. |
boolean |
has(String key)
Whether this object has a particular key.
|
boolean |
hasSameId(ParseObject other) |
void |
increment(String key)
Atomically increments the given key by 1.
|
void |
increment(String key,
Number amount)
Atomically increments the given key by the given number.
|
boolean |
isDataAvailable()
Gets whether the
ParseObject has been fetched. |
boolean |
isDirty()
Whether any key-value pair in this object (or its children) has been added/updated/removed and
not saved yet.
|
boolean |
isDirty(String key)
Whether a value associated with a key has been added/updated/removed and not saved yet.
|
Set<String> |
keySet()
Returns a set view of the keys contained in this object.
|
void |
pin()
Stores the object and every object it points to in the local datastore, recursively.
|
void |
pin(String name)
Stores the object and every object it points to in the local datastore, recursively.
|
static <T extends ParseObject> |
pinAll(List<T> objects)
Stores the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
pinAll(String name,
List<T> objects)
Stores the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
pinAllInBackground(List<T> objects)
Stores the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
pinAllInBackground(List<T> objects,
SaveCallback callback)
Stores the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
pinAllInBackground(String name,
List<T> objects)
Stores the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
pinAllInBackground(String name,
List<T> objects,
SaveCallback callback)
Stores the objects and every object they point to in the local datastore, recursively.
|
Task<Void> |
pinInBackground()
Stores the object and every object it points to in the local datastore, recursively.
|
void |
pinInBackground(SaveCallback callback)
Stores the object and every object it points to in the local datastore, recursively.
|
Task<Void> |
pinInBackground(String name)
Stores the object and every object it points to in the local datastore, recursively.
|
void |
pinInBackground(String name,
SaveCallback callback)
Stores the object and every object it points to in the local datastore, recursively.
|
void |
put(String key,
Object value)
Add a key-value pair to this object.
|
void |
refresh()
Deprecated.
Please use
ParseObject.fetch() instead. |
void |
refreshInBackground(RefreshCallback callback)
Deprecated.
Please use
ParseObject.fetchInBackground(GetCallback) instead. |
static void |
registerSubclass(Class<? extends ParseObject> subclass)
Registers a custom subclass type with the Parse SDK, enabling strong-typing of those
ParseObject s whenever they appear. |
void |
remove(String key)
Removes a key from this object's data if it exists.
|
void |
removeAll(String key,
Collection<?> values)
Atomically removes all instances of the objects contained in a
Collection from the
array associated with a given key. |
void |
revert()
Clears any changes to this object made since the last call to
ParseObject.save() or
ParseObject.saveInBackground() . |
void |
revert(String key)
Clears changes to this object's
key made since the last call to ParseObject.save() or
ParseObject.saveInBackground() . |
void |
save()
Saves this object to the server.
|
static <T extends ParseObject> |
saveAll(List<T> objects)
Saves each object in the provided list.
|
static <T extends ParseObject> |
saveAllInBackground(List<T> objects)
Saves each object in the provided list to the server in a background thread.
|
static <T extends ParseObject> |
saveAllInBackground(List<T> objects,
SaveCallback callback)
Saves each object in the provided list to the server in a background thread.
|
Task<Void> |
saveEventually()
Saves this object to the server at some unspecified time in the future, even if Parse is
currently inaccessible.
|
void |
saveEventually(SaveCallback callback)
Saves this object to the server at some unspecified time in the future, even if Parse is
currently inaccessible.
|
Task<Void> |
saveInBackground()
Saves this object to the server in a background thread.
|
void |
saveInBackground(SaveCallback callback)
Saves this object to the server in a background thread.
|
void |
setACL(ParseACL acl)
Set the
ParseACL governing this object. |
void |
setObjectId(String newObjectId)
Setter for the object id.
|
void |
unpin()
Removes the object and every object it points to in the local datastore, recursively.
|
void |
unpin(String name)
Removes the object and every object it points to in the local datastore, recursively.
|
static void |
unpinAll()
Removes the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
unpinAll(List<T> objects)
Removes the objects and every object they point to in the local datastore, recursively.
|
static void |
unpinAll(String name)
Removes the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
unpinAll(String name,
List<T> objects)
Removes the objects and every object they point to in the local datastore, recursively.
|
static Task<Void> |
unpinAllInBackground()
Removes the objects and every object they point to in the local datastore, recursively.
|
static void |
unpinAllInBackground(DeleteCallback callback)
Removes the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
unpinAllInBackground(List<T> objects)
Removes the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
unpinAllInBackground(List<T> objects,
DeleteCallback callback)
Removes the objects and every object they point to in the local datastore, recursively.
|
static Task<Void> |
unpinAllInBackground(String name)
Removes the objects and every object they point to in the local datastore, recursively.
|
static void |
unpinAllInBackground(String name,
DeleteCallback callback)
Removes the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
unpinAllInBackground(String name,
List<T> objects)
Removes the objects and every object they point to in the local datastore, recursively.
|
static <T extends ParseObject> |
unpinAllInBackground(String name,
List<T> objects,
DeleteCallback callback)
Removes the objects and every object they point to in the local datastore, recursively.
|
Task<Void> |
unpinInBackground()
Removes the object and every object it points to in the local datastore, recursively.
|
void |
unpinInBackground(DeleteCallback callback)
Removes the object and every object it points to in the local datastore, recursively.
|
Task<Void> |
unpinInBackground(String name)
Removes the object and every object it points to in the local datastore, recursively.
|
void |
unpinInBackground(String name,
DeleteCallback callback)
Removes the object and every object it points to in the local datastore, recursively.
|
public static final String DEFAULT_PIN
protected ParseObject()
ParseClassName
annotation on the subclass.public ParseObject(String theClassName)
ParseObject
with no data in it. A ParseObject
constructed in
this way will not have an objectId and will not persist to the database until ParseObject.save()
is called.
Class names must be alphanumerical plus underscore, and start with a letter. It is recommended
to name classes in PascalCaseLikeThis
.
theClassName
- The className for this ParseObject
.public static ParseObject create(String className)
ParseObject
based upon a class name. If the class name is a special type
(e.g. for ParseUser
), then the appropriate type of ParseObject
is returned.className
- The class of object to create.ParseObject
for the given class name.public static <T extends ParseObject> T create(Class<T> subclass)
ParseObject
based upon a subclass type. Note that the object will be
created based upon the ParseClassName
of the given subclass type. For example, calling
create(ParseUser.class) may create an instance of a custom subclass of ParseUser
.subclass
- The class of object to create.ParseObject
based upon the class name of the given subclass type.public static ParseObject createWithoutData(String className, String objectId)
ParseObject
for use in creating associations between
ParseObject
s. Calling ParseObject.isDataAvailable()
on this object will return
false
until ParseObject.fetchIfNeeded()
or ParseObject.refresh()
has been called. No network
request will be made.className
- The object's class.objectId
- The object id for the referenced object.ParseObject
without data.public static <T extends ParseObject> T createWithoutData(Class<T> subclass, String objectId)
ParseObject
for use in creating associations between
ParseObject
s. Calling ParseObject.isDataAvailable()
on this object will return
false
until ParseObject.fetchIfNeeded()
or ParseObject.refresh()
has been called. No network
request will be made.subclass
- The ParseObject
subclass to create.objectId
- The object id for the referenced object.ParseObject
without data.public static void registerSubclass(Class<? extends ParseObject> subclass)
ParseObject
s whenever they appear. Subclasses must specify the ParseClassName
annotation and have a default constructor.subclass
- The subclass type to register.public String getClassName()
public Date getUpdatedAt()
ParseObject
, then
wait a while, and then call ParseObject.save()
, the updated time will be the time of the
ParseObject.save()
call rather than the time the object was changed locally.public Date getCreatedAt()
ParseObject
, then wait a
while, and then call ParseObject.save()
, the creation time will be the time of the first
ParseObject.save()
call rather than the time the object was created locally.public Set<String> keySet()
public void revert(String key)
key
made since the last call to ParseObject.save()
or
ParseObject.saveInBackground()
.key
- The key
to revert changes for.public void revert()
ParseObject.save()
or
ParseObject.saveInBackground()
.public boolean isDirty()
public boolean isDirty(String key)
key
- The key to check forpublic String getObjectId()
public void setObjectId(String newObjectId)
ParseObject
yourself and wish
to recreate it, you can use this to recreate the ParseObject
exactly.public final void save() throws ParseException
ParseObject.saveInBackground()
instead of
this, unless you are managing your own threading.ParseException
- Throws an exception if the server is inaccessible.public final Task<Void> saveInBackground()
ParseObject.save()
,
unless your code is already running from a background thread.Task
that is resolved when the save completes.public final void saveInBackground(SaveCallback callback)
ParseObject.save()
,
unless your code is already running from a background thread.callback
- callback.done(e)
is called when the save completes.public final void saveEventually(SaveCallback callback)
#saveEventually()
or ParseObject.deleteEventually()
will cause old
saves to be silently discarded until the connection can be re-established, and the queued
objects can be saved.callback
- - A callback which will be called if the save completes before the app exits.public final Task<Void> saveEventually()
#saveEventually()
or ParseObject.deleteEventually()
will cause old
saves to be silently discarded until the connection can be re-established, and the queued
objects can be saved.Task
that is resolved when the save completes.public final void deleteEventually(DeleteCallback callback)
#deleteEventually()
or
ParseObject.saveEventually()
will cause old instructions to be silently discarded until the
connection can be re-established, and the queued objects can be saved.callback
- - A callback which will be called if the delete completes before the app exits.public final Task<Void> deleteEventually()
#deleteEventually()
or
ParseObject.saveEventually()
will cause old instructions to be silently discarded until the
connection can be re-established, and the queued objects can be saved.Task
that is resolved when the delete completes.@Deprecated public final void refresh() throws ParseException
ParseObject.fetch()
instead.ParseException
- Throws an exception if the server is inaccessible.@Deprecated public final void refreshInBackground(RefreshCallback callback)
ParseObject.fetchInBackground(GetCallback)
instead.callback
- callback.done(object, e)
is called when the refresh completes.public <T extends ParseObject> T fetch() throws ParseException
ParseObject
that was fetched.ParseException
- Throws an exception if the server is inaccessible.public final <T extends ParseObject> Task<T> fetchInBackground()
Task
that is resolved when fetch completes.public final <T extends ParseObject> void fetchInBackground(GetCallback<T> callback)
callback
- callback.done(object, e)
is called when the fetch completes.public final <T extends ParseObject> Task<T> fetchIfNeededInBackground()
ParseObject
has not been fetched (i.e. ParseObject.isDataAvailable()
returns false
),
fetches this object with the data from the server in a background thread. This is preferable to
using ParseObject.fetchIfNeeded()
, unless your code is already running from a background thread.Task
that is resolved when fetch completes.public <T extends ParseObject> T fetchIfNeeded() throws ParseException
ParseObject
has not been fetched (i.e. ParseObject.isDataAvailable()
returns false
),
fetches this object with the data from the server.ParseObject
.ParseException
- Throws an exception if the server is inaccessible.public final <T extends ParseObject> void fetchIfNeededInBackground(GetCallback<T> callback)
ParseObject
has not been fetched (i.e. ParseObject.isDataAvailable()
returns false
),
fetches this object with the data from the server in a background thread. This is preferable to
using ParseObject.fetchIfNeeded()
, unless your code is already running from a background thread.callback
- callback.done(object, e)
is called when the fetch completes.public final Task<Void> deleteInBackground()
ParseObject.delete()
, unless your code is already running from a background thread.Task
that is resolved when delete completes.public final void delete() throws ParseException
ParseException
- Throws an error if the object does not exist or if the internet fails.public final void deleteInBackground(DeleteCallback callback)
ParseObject.delete()
, unless your code is already running from a background thread.callback
- callback.done(e)
is called when the save completes.public static <T extends ParseObject> void deleteAll(List<T> objects) throws ParseException
objects
- The objects to delete.ParseException
- Throws an exception if the server returns an error or is inaccessible.public static <T extends ParseObject> void deleteAllInBackground(List<T> objects, DeleteCallback callback)
objects
- The objects to delete.callback
- The callback method to execute when completed.public static <T extends ParseObject> Task<Void> deleteAllInBackground(List<T> objects)
objects
- The objects to delete.Task
that is resolved when deleteAll completes.public static <T extends ParseObject> void saveAll(List<T> objects) throws ParseException
objects
- The objects to save.ParseException
- Throws an exception if the server returns an error or is inaccessible.public static <T extends ParseObject> void saveAllInBackground(List<T> objects, SaveCallback callback)
objects
- The objects to save.callback
- callback.done(e)
is called when the save completes.public static <T extends ParseObject> Task<Void> saveAllInBackground(List<T> objects)
objects
- The objects to save.Task
that is resolved when saveAll completes.public static <T extends ParseObject> Task<List<T>> fetchAllIfNeededInBackground(List<T> objects)
objects
- The list of objects to fetch.Task
that is resolved when fetchAllIfNeeded completes.public static <T extends ParseObject> List<T> fetchAllIfNeeded(List<T> objects) throws ParseException
objects
- The list of objects to fetch.ParseException
- Throws an exception if the server returns an error or is inaccessible.public static <T extends ParseObject> void fetchAllIfNeededInBackground(List<T> objects, FindCallback<T> callback)
objects
- The list of objects to fetch.callback
- callback.done(result, e)
is called when the fetch completes.public static <T extends ParseObject> Task<List<T>> fetchAllInBackground(List<T> objects)
objects
- The list of objects to fetch.Task
that is resolved when fetch completes.public static <T extends ParseObject> List<T> fetchAll(List<T> objects) throws ParseException
objects
- The list of objects to fetch.ParseException
- Throws an exception if the server returns an error or is inaccessible.public static <T extends ParseObject> void fetchAllInBackground(List<T> objects, FindCallback<T> callback)
objects
- The list of objects to fetch.callback
- callback.done(result, e)
is called when the fetch completes.public void put(String key, Object value)
camelCaseLikeThis
.key
- Keys must be alphanumerical plus underscore, and start with a letter.value
- Values may be numerical, String
, JSONObject
, JSONArray
,
JSONObject.NULL
, or other ParseObject
s. value may not be null
.public boolean has(String key)
ParseObject.containsKey(String)
.key
- The key to check forpublic void increment(String key)
key
- The key to increment.public void increment(String key, Number amount)
key
- The key to increment.amount
- The amount to increment by.public void add(String key, Object value)
key
- The key.value
- The object to add.public void addAll(String key, Collection<?> values)
Collection
to the end of the array
associated with a given key.key
- The key.values
- The objects to add.public void addUnique(String key, Object value)
key
- The key.value
- The object to add.public void addAllUnique(String key, Collection<?> values)
Collection
to the array associated with a
given key, only adding elements which are not already present in the array. The position of the
insert is not guaranteed.key
- The key.values
- The objects to add.public void remove(String key)
key
- The key to remove.public void removeAll(String key, Collection<?> values)
Collection
from the
array associated with a given key. To maintain consistency with the Java Collection API, there
is no method removing all instances of a single object. Instead, you can call
parseObject.removeAll(key, Arrays.asList(value))
.key
- The key.values
- The objects to remove.public boolean containsKey(String key)
ParseObject.has(String)
.key
- The key to check forpublic String getString(String key)
String
value.key
- The key to access the value for.null
if there is no such key or if it is not a String
.public byte[] getBytes(String key)
byte[]
value.key
- The key to access the value for.null
if there is no such key or if it is not a byte[]
.public Number getNumber(String key)
Number
value.key
- The key to access the value for.null
if there is no such key or if it is not a Number
.public JSONArray getJSONArray(String key)
JSONArray
value.key
- The key to access the value for.null
if there is no such key or if it is not a JSONArray
.public <T> List<T> getList(String key)
List
value.key
- The key to access the value fornull
if there is no such key or if the value can't be converted to a
List
.public <V> Map<String,V> getMap(String key)
Map
valuekey
- The key to access the value fornull
if there is no such key or if the value can't be converted to a
Map
.public JSONObject getJSONObject(String key)
JSONObject
value.key
- The key to access the value for.null
if there is no such key or if it is not a JSONObject
.public int getInt(String key)
int
value.key
- The key to access the value for.0
if there is no such key or if it is not a int
.public double getDouble(String key)
double
value.key
- The key to access the value for.0
if there is no such key or if it is not a double
.public long getLong(String key)
long
value.key
- The key to access the value for.0
if there is no such key or if it is not a long
.public boolean getBoolean(String key)
boolean
value.key
- The key to access the value for.false
if there is no such key or if it is not a boolean
.public Date getDate(String key)
Date
value.key
- The key to access the value for.null
if there is no such key or if it is not a Date
.public ParseObject getParseObject(String key)
ParseObject
value. This function will not perform a network request. Unless the
ParseObject
has been downloaded (e.g. by a ParseQuery.include(String)
or by calling
ParseObject.fetchIfNeeded()
or ParseObject.refresh()
), ParseObject.isDataAvailable()
will return
false
.key
- The key to access the value for.null
if there is no such key or if it is not a ParseObject
.public ParseUser getParseUser(String key)
ParseUser
value. This function will not perform a network request. Unless the
ParseObject
has been downloaded (e.g. by a ParseQuery.include(String)
or by calling
ParseObject.fetchIfNeeded()
or ParseObject.refresh()
), ParseObject.isDataAvailable()
will return
false
.key
- The key to access the value for.null
if there is no such key or if the value is not a ParseUser
.public ParseFile getParseFile(String key)
ParseFile
value. This function will not perform a network request. Unless the
ParseFile
has been downloaded (e.g. by calling ParseFile.getData()
),
ParseFile.isDataAvailable()
will return false
.key
- The key to access the value for.null
if there is no such key or if it is not a ParseFile
.public ParseGeoPoint getParseGeoPoint(String key)
ParseGeoPoint
value.key
- The key to access the value fornull
if there is no such key or if it is not a ParseGeoPoint
.public boolean isDataAvailable()
ParseObject
has been fetched.true
if the ParseObject
is new or has been fetched or refreshed. false
otherwise.public <T extends ParseObject> ParseRelation<T> getRelation(String key)
ParseRelation
value for a keykey
- The key to access the relation for.public Object get(String key)
ParseObject.getString(String)
or ParseObject.getInt(String)
.key
- The key to access the value for.null
if there is no such key.public boolean hasSameId(ParseObject other)
public static <T extends ParseObject> void pinAllInBackground(String name, List<T> objects, SaveCallback callback)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on it.name
- the nameobjects
- the objects to be pinnedcallback
- the callbackParseObject.unpinAllInBackground(String, java.util.List, DeleteCallback)
public static <T extends ParseObject> Task<Void> pinAllInBackground(String name, List<T> objects)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on it.name
- the nameobjects
- the objects to be pinnedTask
that is resolved when pinning all completes.ParseObject.unpinAllInBackground(String, java.util.List)
public static <T extends ParseObject> void pinAll(String name, List<T> objects) throws ParseException
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on it.
ParseObject.fetchFromLocalDatastore()
on it.name
- the nameobjects
- the objects to be pinnedParseException
ParseObject.unpinAll(String, java.util.List)
public static <T extends ParseObject> void pinAllInBackground(List<T> objects, SaveCallback callback)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on it.objects
- the objects to be pinnedcallback
- the callbackParseObject.unpinAllInBackground(java.util.List, DeleteCallback)
,
ParseObject.DEFAULT_PIN
public static <T extends ParseObject> Task<Void> pinAllInBackground(List<T> objects)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on it.objects
- the objects to be pinnedTask
that is resolved when pinning all completes.ParseObject.unpinAllInBackground(java.util.List)
,
ParseObject.DEFAULT_PIN
public static <T extends ParseObject> void pinAll(List<T> objects) throws ParseException
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on it.objects
- the objects to be pinnedParseException
ParseObject.unpinAll(java.util.List)
,
ParseObject.DEFAULT_PIN
public static <T extends ParseObject> void unpinAllInBackground(String name, List<T> objects, DeleteCallback callback)
name
- the nameobjects
- the objectscallback
- the callbackParseObject.pinAllInBackground(String, java.util.List, SaveCallback)
public static <T extends ParseObject> Task<Void> unpinAllInBackground(String name, List<T> objects)
name
- the nameobjects
- the objectsTask
that is resolved when unpinning all completes.ParseObject.pinAllInBackground(String, java.util.List)
public static <T extends ParseObject> void unpinAll(String name, List<T> objects) throws ParseException
name
- the nameobjects
- the objectsParseException
ParseObject.pinAll(String, java.util.List)
public static <T extends ParseObject> void unpinAllInBackground(List<T> objects, DeleteCallback callback)
objects
- the objectscallback
- the callbackParseObject.pinAllInBackground(java.util.List, SaveCallback)
,
ParseObject.DEFAULT_PIN
public static <T extends ParseObject> Task<Void> unpinAllInBackground(List<T> objects)
objects
- the objectsTask
that is resolved when unpinning all completes.ParseObject.pinAllInBackground(java.util.List)
,
ParseObject.DEFAULT_PIN
public static <T extends ParseObject> void unpinAll(List<T> objects) throws ParseException
objects
- the objectsParseException
ParseObject.pinAll(java.util.List)
,
ParseObject.DEFAULT_PIN
public static void unpinAllInBackground(String name, DeleteCallback callback)
name
- the namecallback
- the callbackParseObject.pinAll(String, java.util.List)
public static Task<Void> unpinAllInBackground(String name)
name
- the nameTask
that is resolved when unpinning all completes.ParseObject.pinAll(String, java.util.List)
public static void unpinAll(String name) throws ParseException
name
- the nameParseException
ParseObject.pinAll(String, java.util.List)
public static void unpinAllInBackground(DeleteCallback callback)
callback
- the callbackParseObject.pinAllInBackground(java.util.List, SaveCallback)
,
ParseObject.DEFAULT_PIN
public static Task<Void> unpinAllInBackground()
Task
that is resolved when unpinning all completes.ParseObject.pinAllInBackground(java.util.List, SaveCallback)
,
ParseObject.DEFAULT_PIN
public static void unpinAll() throws ParseException
ParseException
ParseObject.pinAll(java.util.List)
,
ParseObject.DEFAULT_PIN
public <T extends ParseObject> void fetchFromLocalDatastoreInBackground(GetCallback<T> callback)
public void fetchFromLocalDatastore() throws ParseException
ParseException
public void pinInBackground(String name, SaveCallback callback)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on
it.callback
- the callbackParseObject.unpinInBackground(String, DeleteCallback)
public Task<Void> pinInBackground(String name)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on
it.Task
that is resolved when pinning completes.ParseObject.unpinInBackground(String)
public void pin(String name) throws ParseException
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on
it.ParseException
ParseObject.unpin(String)
public void pinInBackground(SaveCallback callback)
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on
it.callback
- the callbackParseObject.unpinInBackground(DeleteCallback)
,
ParseObject.DEFAULT_PIN
public Task<Void> pinInBackground()
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on
it.Task
that is resolved when pinning completes.ParseObject.unpinInBackground()
,
ParseObject.DEFAULT_PIN
public void pin() throws ParseException
ParseQuery.fromLocalDatastore()
, or you can create an unfetched pointer with
ParseObject.createWithoutData(Class, String)
and then call ParseObject.fetchFromLocalDatastore()
on
it.ParseException
ParseObject.unpin()
,
ParseObject.DEFAULT_PIN
public void unpinInBackground(String name, DeleteCallback callback)
callback
- the callbackParseObject.pinInBackground(String, SaveCallback)
public Task<Void> unpinInBackground(String name)
Task
that is resolved when unpinning completes.ParseObject.pinInBackground(String)
public void unpin(String name) throws ParseException
ParseException
ParseObject.pin(String)
public void unpinInBackground(DeleteCallback callback)
callback
- the callbackParseObject.pinInBackground(SaveCallback)
,
ParseObject.DEFAULT_PIN
public Task<Void> unpinInBackground()
Task
that is resolved when unpinning completes.ParseObject.pinInBackground()
,
ParseObject.DEFAULT_PIN
public void unpin() throws ParseException
ParseException
ParseObject.pin()
,
ParseObject.DEFAULT_PIN