當前位置: 首頁>>代碼示例>>Java>>正文


Java GraphObjectList.add方法代碼示例

本文整理匯總了Java中com.facebook.model.GraphObjectList.add方法的典型用法代碼示例。如果您正苦於以下問題:Java GraphObjectList.add方法的具體用法?Java GraphObjectList.add怎麽用?Java GraphObjectList.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.model.GraphObjectList的用法示例。


在下文中一共展示了GraphObjectList.add方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createGetPermissionsRequest

import com.facebook.model.GraphObjectList; //導入方法依賴的package包/類
@Override
Request createGetPermissionsRequest(String accessToken) {
    final List<String> permissions = permissionsToReport;
    return new MockRequest() {
        @Override
        public Response createResponse() {
            GraphObject permissionsObject = GraphObject.Factory.create();
            if (permissions != null) {
                for (String permission : permissions) {
                    permissionsObject.setProperty(permission, 1);
                }
            }
            GraphObjectList<GraphObject> data = GraphObject.Factory.createList(GraphObject.class);
            data.add(permissionsObject);

            GraphMultiResult result = GraphObject.Factory.create(GraphMultiResult.class);
            result.setProperty("data", data);

            return new Response(this, null, result, false);
        }
    };
}
 
開發者ID:kodamirmo,項目名稱:LostAndFound,代碼行數:23,代碼來源:AuthorizationClientTests.java

示例2: createGetPermissionsRequest

import com.facebook.model.GraphObjectList; //導入方法依賴的package包/類
@Override
Request createGetPermissionsRequest(String accessToken) {
    final List<String> permissions = permissionsToReport;
    return new MockRequest() {
        @Override
        public Response createResponse() {
            GraphObject permissionsObject = GraphObject.Factory.create();
            if (permissions != null) {
                for (String permission : permissions) {
                    permissionsObject.setProperty(permission, 1);
                }
            }
            GraphObjectList<GraphObject> data = GraphObject.Factory.createList(GraphObject.class);
            data.add(permissionsObject);

            GraphMultiResult result = GraphObject.Factory.create(GraphMultiResult.class);
            result.setProperty("data", data);

            return new Response(this, null, null, result, false);
        }
    };
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:23,代碼來源:AuthorizationClientTests.java

示例3: updateObjectAttachmentUrls

import com.facebook.model.GraphObjectList; //導入方法依賴的package包/類
void updateObjectAttachmentUrls(String objectProperty, List<String> attachmentUrls, boolean isUserGenerated) {
    final OpenGraphObject object;
    try {
        object = action.getPropertyAs(objectProperty, OpenGraphObject.class);
        if (object == null) {
            throw new IllegalArgumentException("Action does not contain a property '" + objectProperty + "'");
        }
    } catch (FacebookGraphObjectException exception) {
        throw new IllegalArgumentException("Property '" + objectProperty + "' is not a graph object");
    }
    if (!object.getCreateObject()) {
        throw new IllegalArgumentException(
                "The Open Graph object in '" + objectProperty + "' is not marked for creation");
    }

    GraphObjectList<GraphObject> attachments = object.getImage();
    if (attachments == null) {
        attachments = GraphObject.Factory.createList(GraphObject.class);
    }
    for (String url : attachmentUrls) {
        GraphObject graphObject = GraphObject.Factory.create();
        graphObject.setProperty(NativeProtocol.IMAGE_URL_KEY, url);
        if (isUserGenerated) {
            graphObject.setProperty(NativeProtocol.IMAGE_USER_GENERATED_KEY, true);
        }
        attachments.add(graphObject);
    }
    object.setImage(attachments);
}
 
開發者ID:yeloapp,項目名稱:yelo-android,代碼行數:30,代碼來源:FacebookDialog.java


注:本文中的com.facebook.model.GraphObjectList.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。