| 限定符和类型 | 类和说明 |
|---|---|
static class |
AVObject.Hook |
| 限定符和类型 | 字段和说明 |
|---|---|
protected AVACL |
acl |
protected String |
className |
protected String |
endpointClassName |
static String |
KEY_ACL |
static String |
KEY_CLASSNAME |
static String |
KEY_CREATED_AT |
static String |
KEY_IGNORE_HOOKS |
static String |
KEY_OBJECT_ID |
static String |
KEY_UPDATED_AT |
protected static AVLogger |
logger |
protected String |
objectId |
protected ConcurrentMap<String,cn.leancloud.ops.ObjectFieldOperation> |
operations |
protected ConcurrentMap<String,Object> |
serverData |
protected boolean |
totallyOverwrite |
protected static int |
UUID_LEN |
| 构造器和说明 |
|---|
AVObject()
Default constructor.
|
AVObject(AVObject other)
Copy constructor.
|
AVObject(String className)
Constructor with class name.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abortOperations()
abort all modify operations.
|
void |
add(String key,
Object value)
Add attribute.
|
void |
addAll(String key,
Collection<?> values)
Add collection attribute.
|
void |
addAllUnique(String key,
Collection<?> values)
Add unique collection attribute.
|
protected void |
addNewOperation(cn.leancloud.ops.ObjectFieldOperation op) |
void |
addUnique(String key,
Object value)
Add unique attribute.
|
void |
bitAnd(String key,
long value)
Modify integer attribute.
|
void |
bitOr(String key,
long value)
Modify integer attribute.
|
void |
bitXor(String key,
long value)
Modify integer attribute.
|
protected static <T extends AVObject> |
cast(AVObject object,
Class<T> clazz) |
boolean |
containsKey(String key)
Contain specified key.
|
static <T extends AVObject> |
createWithoutData(Class<T> clazz,
String objectId)
Create a new instance with particular class and objectId.
|
static AVObject |
createWithoutData(String className,
String objectId)
Create a new instance with particular classname and objectId.
|
void |
decrement(String key)
Decrement one attribute.
|
void |
decrement(String key,
Number value)
Decrement one attribute.
|
void |
delete()
Delete current object in blocking mode.
|
static void |
deleteAll(Collection<? extends AVObject> objects)
Delete all objects in blocking mode.
|
static io.reactivex.Observable<AVNull> |
deleteAllInBackground(Collection<? extends AVObject> objects)
Delete all objects in async mode.
|
void |
deleteEventually()
Delete current object eventually.
|
io.reactivex.Observable<AVNull> |
deleteInBackground()
Delete current object in async mode.
|
void |
disableAfterHook()
disable afterXXX Hooks
|
void |
disableBeforeHook()
disable beforeXXX Hooks
|
boolean |
equals(Object o) |
protected List<AVObject> |
extractCascadingObjects(Object o) |
protected List<AVFile> |
extractUnsavedFiles(Object o) |
AVObject |
fetch()
Fetch current object in blocking mode.
|
AVObject |
fetch(String includeKeys)
Fetch current object in blocking mode.
|
AVObject |
fetchIfNeeded()
Fetch current object in blocking mode.
|
io.reactivex.Observable<AVObject> |
fetchIfNeededInBackground()
Fetch current object if needed in async mode.
|
io.reactivex.Observable<AVObject> |
fetchIfNeededInBackground(String includeKeys)
Fetch current object if needed in async mode.
|
io.reactivex.Observable<AVObject> |
fetchInBackground()
Fetch current object in async mode.
|
io.reactivex.Observable<AVObject> |
fetchInBackground(String includeKeys)
Fetch current object in async mode.
|
protected AVACL |
generateACLFromServerData() |
protected io.reactivex.Observable<List<AVObject>> |
generateCascadingSaveObjects() |
protected com.alibaba.fastjson.JSONObject |
generateChangedParam()
save/update with server.
|
Object |
get(String key)
Get value of specified key.
|
AVACL |
getACL()
get ACL
|
AVFile |
getAVFile(String key)
Get AVFile value of specified key.
|
AVGeoPoint |
getAVGeoPoint(String key)
Get AVGeoPoint value of specified key.
|
<T extends AVObject> |
getAVObject(String key)
Get AVObject value of specified key.
|
boolean |
getBoolean(String key)
Get boolean value of specified key.
|
byte[] |
getBytes(String key)
Get bytes value of specified key.
|
String |
getClassName()
Get class name.
|
Date |
getCreatedAt()
Get createdAt date.
|
String |
getCreatedAtString()
Get createdAt string.
|
Date |
getDate(String key)
Get Date value of specified key.
|
double |
getDouble(String key)
Get double value of specified key.
|
int |
getInt(String key)
Get int value of specified key.
|
com.alibaba.fastjson.JSONArray |
getJSONArray(String key)
Get jsonarray value of specified key.
|
com.alibaba.fastjson.JSONObject |
getJSONObject(String key)
Get jsonobject value of specified key.
|
List |
getList(String key)
Get list value of specified key.
|
long |
getLong(String key)
Get long value of specified key.
|
Number |
getNumber(String key)
Get numeric value of specified key.
|
String |
getObjectId()
Get objectId.
|
static <T extends AVObject> |
getQuery(Class<T> clazz)
Get query for class.
|
<T extends AVObject> |
getRelation(String key)
Get AVRelation value of specified key.
|
String |
getRequestMethod()
Get request method.
|
String |
getRequestRawEndpoint()
Get request endpoint.
|
ConcurrentMap<String,Object> |
getServerData()
Get server data.
|
String |
getString(String key)
Get string value of specified key.
|
protected List<AVFile> |
getUnsavedFiles() |
Date |
getUpdatedAt()
Get updatedAt date.
|
String |
getUpdatedAtString()
Get updatedAt string.
|
String |
getUuid()
Get UUID.
|
boolean |
has(String key)
Contain specified key.
|
boolean |
hasCircleReference(Map<AVObject,Boolean> markMap)
judge operations' value include circle reference or not.
|
int |
hashCode() |
void |
ignoreHook(AVObject.Hook hook)
ignore specified Hook
|
void |
increment(String key)
Increment one attribute.
|
void |
increment(String key,
Number value)
Increment one attribute.
|
String |
internalClassName()
Get internal class name.
|
protected String |
internalId() |
boolean |
isDataAvailable()
Flag to indicate data is available or not.
|
boolean |
isFetchWhenSave()
Flag to fetchWhenSave.
|
protected void |
onDataSynchronized() |
protected void |
onSaveFailure() |
protected void |
onSaveSuccess() |
static AVObject |
parseAVObject(String objectString)
Create AVObject instance from json string which generated by AVObject.toString or AVObject.toJSONString.
|
void |
put(String key,
Object value)
Set attribute.
|
void |
refresh()
Refresh current object in blocking mode.
|
void |
refresh(String includeKeys)
Refresh current object in blocking mode.
|
io.reactivex.Observable<AVObject> |
refreshInBackground()
Refresh current object in async mode.
|
io.reactivex.Observable<AVObject> |
refreshInBackground(String includeKeys)
Refresh current object in async mode.
|
static <T extends AVObject> |
registerSubclass(Class<T> clazz)
Register subclass to AVOSCloud SDK.It must be invocated before AVOSCloud.initialize.
|
void |
remove(String key)
Remove attribute.
|
void |
removeAll(String key,
Collection<?> values)
Remove all collection.
|
protected void |
resetAll() |
protected void |
resetByRawData(AVObject avObject) |
void |
resetServerData(Map<String,Object> data)
Reset server data with new data.
|
void |
save()
Save in blocking mode.
|
static void |
saveAll(Collection<? extends AVObject> objects)
Save All objects in blocking mode.
|
static io.reactivex.Observable<com.alibaba.fastjson.JSONArray> |
saveAllInBackground(Collection<? extends AVObject> objects)
Save all objects in async mode.
|
void |
saveEventually()
Save eventually.
|
io.reactivex.Observable<? extends AVObject> |
saveInBackground()
Save object in background.
|
io.reactivex.Observable<? extends AVObject> |
saveInBackground(AVSaveOption option)
Save object in background.
|
void |
setACL(AVACL acl)
Set ACL
|
void |
setClassName(String name)
Set class name.
|
void |
setFetchWhenSave(boolean fetchWhenSave)
Set fetchWhenSave flag.
|
void |
setObjectId(String objectId)
Set objectId.
|
com.alibaba.fastjson.JSONObject |
toJSONObject()
Generate a new json object with server data.
|
String |
toJSONString()
Generate a json string.
|
String |
toString() |
protected void |
validFieldName(String key) |
protected static boolean |
verifyInternalId(String internalId) |
protected static final AVLogger logger
protected static final int UUID_LEN
protected String className
protected String endpointClassName
protected String objectId
protected ConcurrentMap<String,Object> serverData
protected ConcurrentMap<String,cn.leancloud.ops.ObjectFieldOperation> operations
protected AVACL acl
protected volatile boolean totallyOverwrite
public AVObject()
public AVObject(String className)
className - class name.public AVObject(AVObject other)
other - other instance.public String getClassName()
public String internalClassName()
public void setClassName(String name)
name - class name.public Date getCreatedAt()
public String getCreatedAtString()
public Date getUpdatedAt()
public String getUpdatedAtString()
public String getObjectId()
public void setObjectId(String objectId)
objectId - object id.public boolean isFetchWhenSave()
public void setFetchWhenSave(boolean fetchWhenSave)
fetchWhenSave - flag.public String getUuid()
protected static boolean verifyInternalId(String internalId)
protected String internalId()
public boolean containsKey(String key)
key - keypublic boolean has(String key)
key - keypublic Object get(String key)
key - specified key.public boolean getBoolean(String key)
key - specified key.public byte[] getBytes(String key)
key - specified key.public Date getDate(String key)
key - specified key.public String getString(String key)
key - specified key.public int getInt(String key)
key - specified key.public long getLong(String key)
key - specified key.public double getDouble(String key)
key - specified key.public Number getNumber(String key)
key - specified key.public List getList(String key)
key - specified key.public com.alibaba.fastjson.JSONArray getJSONArray(String key)
key - specified key.public com.alibaba.fastjson.JSONObject getJSONObject(String key)
key - specified key.public AVGeoPoint getAVGeoPoint(String key)
key - specified key.public AVFile getAVFile(String key)
key - specified key.public <T extends AVObject> T getAVObject(String key)
T - template typekey - specified key.public <T extends AVObject> AVRelation<T> getRelation(String key)
T - template typekey - specified key.public ConcurrentMap<String,Object> getServerData()
protected void validFieldName(String key)
public boolean isDataAvailable()
public void add(String key, Object value)
key - target key.value - value object.public void addAll(String key, Collection<?> values)
key - target key.values - values collection.public void addUnique(String key, Object value)
key - target key.value - value object.public void addAllUnique(String key, Collection<?> values)
key - target key.values - value collection.public void put(String key, Object value)
key - target key.value - value object.public void remove(String key)
key - target key.public void removeAll(String key, Collection<?> values)
key - target keys.values - value collection.public void increment(String key)
key - target key.public void increment(String key, Number value)
key - target key.value - value object.public void decrement(String key)
key - target key.public void decrement(String key, Number value)
key - target key.value - value object.public void bitAnd(String key, long value)
key - target key.value - value object.public void bitOr(String key, long value)
key - target key.value - value object.public void bitXor(String key, long value)
key - target key.value - value object.public void abortOperations()
protected void addNewOperation(cn.leancloud.ops.ObjectFieldOperation op)
protected com.alibaba.fastjson.JSONObject generateChangedParam()
protected io.reactivex.Observable<List<AVObject>> generateCascadingSaveObjects()
protected void onSaveSuccess()
protected void onSaveFailure()
protected void onDataSynchronized()
public io.reactivex.Observable<? extends AVObject> saveInBackground()
public io.reactivex.Observable<? extends AVObject> saveInBackground(AVSaveOption option)
option - save option.public boolean hasCircleReference(Map<AVObject,Boolean> markMap)
markMap - markup map.public void save()
public static void saveAll(Collection<? extends AVObject> objects) throws AVException
objects - object collection.AVException - error happened.public static io.reactivex.Observable<com.alibaba.fastjson.JSONArray> saveAllInBackground(Collection<? extends AVObject> objects)
objects - object collection.public void saveEventually()
throws AVException
AVException - error happened.public void deleteEventually()
public io.reactivex.Observable<AVNull> deleteInBackground()
public void delete()
public static void deleteAll(Collection<? extends AVObject> objects) throws AVException
objects - object collection.AVException - error happened.public static io.reactivex.Observable<AVNull> deleteAllInBackground(Collection<? extends AVObject> objects)
objects - object collection.public void refresh()
public void refresh(String includeKeys)
includeKeys - include keys, which object will be return together.public io.reactivex.Observable<AVObject> refreshInBackground()
public io.reactivex.Observable<AVObject> refreshInBackground(String includeKeys)
includeKeys - include keys, which object will be return together.public AVObject fetch()
public AVObject fetch(String includeKeys)
includeKeys - include keys, which object will be return together.public io.reactivex.Observable<AVObject> fetchInBackground()
public io.reactivex.Observable<AVObject> fetchInBackground(String includeKeys)
includeKeys - include keys, which object will be return together.public io.reactivex.Observable<AVObject> fetchIfNeededInBackground()
public io.reactivex.Observable<AVObject> fetchIfNeededInBackground(String includeKeys)
includeKeys - include keys, which object will be return together.public AVObject fetchIfNeeded()
protected void resetAll()
protected void resetByRawData(AVObject avObject)
public void resetServerData(Map<String,Object> data)
data - new data.public String getRequestRawEndpoint()
public String getRequestMethod()
public static <T extends AVObject> void registerSubclass(Class<T> clazz)
T - template type.clazz - The subclass.public AVACL getACL()
public void setACL(AVACL acl)
acl - acl object.protected AVACL generateACLFromServerData()
public static <T extends AVObject> AVQuery<T> getQuery(Class<T> clazz)
T - result type.clazz - target class.public com.alibaba.fastjson.JSONObject toJSONObject()
public String toJSONString()
public static AVObject parseAVObject(String objectString)
objectString - json string.public static AVObject createWithoutData(String className, String objectId)
className - class nameobjectId - object idpublic static <T extends AVObject> T createWithoutData(Class<T> clazz, String objectId) throws AVException
T - template type.clazz - class infoobjectId - object idAVException - error happened.public void disableBeforeHook()
public void disableAfterHook()
public void ignoreHook(AVObject.Hook hook)
hook - target Hook.protected static <T extends AVObject> T cast(AVObject object, Class<T> clazz) throws Exception
ExceptionCopyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.