当前位置: 首页>>代码示例>>Java>>正文


Java BoxIterator类代码示例

本文整理汇总了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);
}
 
开发者ID:box,项目名称:box-android-browse-sdk,代码行数:28,代码来源:BoxBrowseFolderFragment.java

示例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();
}
 
开发者ID:box,项目名称:box-android-browse-sdk,代码行数:16,代码来源:BoxBrowseFolderActivity.java

示例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);
}
 
开发者ID:box,项目名称:box-android-sdk,代码行数:6,代码来源:BoxRequestUpload.java


注:本文中的com.box.androidsdk.content.models.BoxIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。