本文整理汇总了Java中com.box.androidsdk.content.models.BoxIterator类的典型用法代码示例。如果您正苦于以下问题:Java BoxIterator类的具体用法?Java BoxIterator怎么用?Java BoxIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BoxIterator类属于com.box.androidsdk.content.models包,在下文中一共展示了BoxIterator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFolderWithoutItems
import com.box.androidsdk.content.models.BoxIterator; //导入依赖的package包/类
/**
* Convenience method that returns a folder object without its item collection. This is done to ensure
* a single source of truth for the item collection
*
* @param folder the folder which may contain items
* @return box folder without any items
*/
protected BoxFolder createFolderWithoutItems(BoxFolder folder) {
JsonObject jsonObject = new JsonObject();
for (String key: folder.getPropertiesKeySet()){
if (!key.equals(BoxFolder.FIELD_ITEM_COLLECTION)){
jsonObject.add(key, folder.getPropertyValue(key));
} else {
JsonObject itemCollection = new JsonObject();
BoxIteratorItems iteratorItems = folder.getItemCollection();
for (String collectionKey : iteratorItems.getPropertiesKeySet()){
if (!collectionKey.equals(BoxIterator.FIELD_ENTRIES)) {
itemCollection.add(collectionKey, iteratorItems.getPropertyValue(collectionKey));
} else {
itemCollection.add(collectionKey, new JsonArray());
}
}
jsonObject.add(key, itemCollection);
}
}
return new BoxFolder(jsonObject);
}
示例2: onClick
import com.box.androidsdk.content.models.BoxIterator; //导入依赖的package包/类
@Override
public void onClick(View v) {
Intent intent = new Intent();
BoxFolder curFolder = getCurrentFolder();
if (curFolder != null) {
JsonObject jsonObject = curFolder.toJsonObject();
JsonValue obj = jsonObject.get(BoxFolder.FIELD_ITEM_COLLECTION);
if (obj != null && !obj.isNull()) {
obj.asObject().set(BoxIterator.FIELD_ENTRIES, new JsonArray());
}
intent.putExtra(EXTRA_BOX_FOLDER, new BoxFolder(jsonObject));
}
setResult(RESULT_OK, intent);
finish();
}
示例3: onResponse
import com.box.androidsdk.content.models.BoxIterator; //导入依赖的package包/类
@Override
public <T extends BoxObject> T onResponse(Class<T> clazz, BoxHttpResponse response) throws IllegalAccessException, InstantiationException, BoxException {
BoxIterator list = (BoxIterator) super.onResponse(BoxIteratorBoxEntity.class, response);
return (T)list.get(0);
}