Android Open Source - BagOfPix Open Graph Object






From Project

Back to project page BagOfPix.

License

The source code is released under:

MIT License

If you think the Android project BagOfPix listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.facebook.model;
/*from  w  w w .  ja  v  a  2s .c om*/
import com.facebook.internal.NativeProtocol;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * Provides a strongly-typed representation of an Open Graph Object.
 * For more documentation of OG Objects, see: https://developers.facebook.com/docs/opengraph/using-object-api/
 *
 * Note that this interface is intended to be used with GraphObject.Factory or OpenGraphObject.Factory
 * and not implemented directly.
 */
public interface OpenGraphObject extends GraphObject {
    /**
     * Gets the ID of the object.
     * @return the ID
     */
    String getId();

    /**
     * Sets the ID of the object.
     * @param id the ID
     */
    void setId(String id);

    /**
     * Gets the type of the object, which is a string in the form "mynamespace:mytype".
     * @return the type
     */
    String getType();

    /**
     * Sets the type of the object, which is a string in the form "mynamespace:mytype".
     * @param type the type
     */
    void setType(String type);

    /**
     * Gets the URL associated with the Open Graph object.
     * @return the URL
     */
    String getUrl();

    /**
     * Sets the URL associated with the Open Graph object.
     * @param url the URL
     */
    void setUrl(String url);

    /**
     * Gets the title of the Open Graph object.
     * @return the title
     */
    String getTitle();

    /**
     * Sets the title of the Open Graph object.
     * @param title the title
     */
    void setTitle(String title);


    /**
     * Gets the description of the Open Graph object.
     * @return the description
     */
    String getDescription();

    /**
     * Sets the description of the Open Graph Object
     * @param description the description
     */
    void setDescription(String description);

    /**
     * Gets the images associated with the Open Graph object.
     * @return the images
     */
    GraphObjectList<GraphObject> getImage();

    /**
     * Sets the images associated with the Open Graph object.
     * @param images the images
     */
    void setImage(GraphObjectList<GraphObject> images);

    /**
     * Sets the images associated with the Open Graph object by specifying their URLs. This is a helper
     * that will create GraphObjects with the correct URLs and populate the property with those objects.
     * @param urls the URLs
     */
    @CreateGraphObject("url")
    @PropertyName("image")
    void setImageUrls(List<String> urls);

    /**
     * Gets the videos associated with the Open Graph object.
     * @return the videos
     */
    GraphObjectList<GraphObject> getVideo();

    /**
     * Sets the videos associated with the Open Graph object.
     * @param videos the videos
     */
    void setVideo(GraphObjectList<GraphObject> videos);

    /**
     * Gets the audio associated with the Open Graph object.
     * @return the audio
     */
    GraphObjectList<GraphObject> getAudio();

    /**
     * Sets the audio associated with the Open Graph object.
     * @param audios the audio
     */
    void setAudio(GraphObjectList<GraphObject> audios);

    /**
     * Gets the "determiner" for the Open Graph object. This is the word such as "a", "an", or "the" that will
     * appear before the title of the object.
     * @return the determiner string
     */
    String getDeterminer();

    /**
     * Sets the "determiner" for the Open Graph object. This is the word such as "a", "an", or "the" that will
     * appear before the title of the object.
     * @param determiner the determiner string
     */
    void setDeterminer(String determiner);

    /**
     * Gets the list of related resources for the Open Graph object.
     * @return a list of URLs of related resources
     */
    List<String> getSeeAlso();

    /**
     * Sets the list of related resources for the Open Graph object.
     * @param seeAlso a list of URLs of related resources
     */
    void setSeeAlso(List<String> seeAlso);

    /**
     * Gets the name of the site hosting the Open Graph object, if any.
     * @return the name of the site
     */
    String getSiteName();

    /**
     * Sets the name of the site hosting the Open Graph object.
     * @param siteName the name of the site
     */
    void setSiteName(String siteName);

    /**
     * Gets the date and time the Open Graph object was created.
     * @return the creation time
     */
    Date getCreatedTime();

    /**
     * Sets the date and time the Open Graph object was created.
     * @param createdTime the creation time
     */
    void setCreatedTime(Date createdTime);

    /**
     * Gets the date and time the Open Graph object was last updated.
     * @return the update time
     */
    Date getUpdatedTime();

    /**
     * Sets the date and time the Open Graph object was last updated.
     * @param updatedTime the update time
     */
    void setUpdatedTime(Date updatedTime);

    /**
     * Gets the application that created this object.
     * @return the application
     */
    GraphObject getApplication();

    /**
     * Sets the application that created this object.
     * @param application the application
     */
    void setApplication(GraphObject application);

    /**
     * Gets whether the Open Graph object was created by scraping a Web resource or not.
     * @return true if the Open Graph object was created by scraping the Web, false if not
     */
    boolean getIsScraped();

    /**
     * Sets whether the Open Graph object was created by scraping a Web resource or not.
     * @param isScraped true if the Open Graph object was created by scraping the Web, false if not
     */
    void setIsScraped(boolean isScraped);

    /**
     * Gets the Open Graph action which was created when this Open Graph action was posted, if it is a user-owned
     * object, otherwise null. The post action controls the privacy of this object.
     * @return the ID of the post action, if any, or null
     */
    String getPostActionId();

    /**
     * Sets the Open Graph action which was created when this Open Graph action was posted, if it is a user-owned
     * object, otherwise null. The post action controls the privacy of this object.
     * @param postActionId the ID of the post action, if any, or null
     */
    void setPostActionId(String postActionId);

    /**
     * Gets the type-specific properties of the Open Graph object, if any. Any custom properties that are defined on an
     * application-defined Open Graph object type will appear here.
     * @return a GraphObject containing the type-specific properties
     */
    GraphObject getData();

    /**
     * Sets the type-specific properties of the Open Graph object, if any. Any custom properties that are defined on an
     * application-defined Open Graph object type will appear here.
     * @param data a GraphObject containing the type-specific properties
     */
    void setData(GraphObject data);

    /**
     * Gets whether the object represents a new object that should be created as part of publishing via, e.g., the
     * native Share dialog. This flag has no effect on explicit publishing of an action via, e.g., a POST to the
     * '/me/objects/object_type' endpoint.
     * @return true if the native Share dialog should create the object as part of publishing an action, false if not
     */
    @PropertyName(NativeProtocol.OPEN_GRAPH_CREATE_OBJECT_KEY)
    boolean getCreateObject();

    /**
     * Sets whether the object represents a new object that should be created as part of publishing via, e.g., the
     * native Share dialog. This flag has no effect on explicit publishing of an action via, e.g., a POST to the
     * '/me/objects/object_type' endpoint.
     * @param createObject true if the native Share dialog should create the object as part of publishing an action,
     *                     false if not
     */
    @PropertyName(NativeProtocol.OPEN_GRAPH_CREATE_OBJECT_KEY)
    void setCreateObject(boolean createObject);

    /**
     * Exposes helpers for creating instances of OpenGraphObject.
     */
    final class Factory {
        /**
         * Creates an OpenGraphObject suitable for posting via, e.g., a native Share dialog. The object will have
         * no properties other than a 'create_object' and 'data' property, ready to be populated.
         * @param type the Open Graph object type for the object, or null if it will be specified later
         * @return an OpenGraphObject
         */
        public static OpenGraphObject createForPost(String type) {
            return createForPost(OpenGraphObject.class, type);
        }

        /**
         * Creates an OpenGraphObject suitable for posting via, e.g., a native Share dialog. The object will have
         * no properties other than a 'create_object' and 'data' property, ready to be populated.
         * @param graphObjectClass the OpenGraphObject-derived type to return
         * @param type the Open Graph object type for the object, or null if it will be specified later
         * @return an OpenGraphObject
         */
        public static <T extends OpenGraphObject> T createForPost(Class<T> graphObjectClass, String type) {
            return createForPost(graphObjectClass, type, null, null, null, null);
        }

        /**
         * Creates an OpenGraphObject suitable for posting via, e.g., a native Share dialog. The object will have
         * the specified properties, plus a 'create_object' and 'data' property, ready to be populated.
         * @param graphObjectClass the OpenGraphObject-derived type to return
         * @param type the Open Graph object type for the object, or null if it will be specified later
         * @param title the title of the object, or null if it will be specified later
         * @param imageUrl the URL of an image associated with the object, or null
         * @param url the URL associated with the object, or null
         * @param description the description of the object, or null
         * @return an OpenGraphObject
         */
        public static <T extends OpenGraphObject> T createForPost(Class<T> graphObjectClass, String type, String title,
                String imageUrl, String url, String description) {
            T object = GraphObject.Factory.create(graphObjectClass);

            if (type != null) {
                object.setType(type);
            }
            if (title != null) {
                object.setTitle(title);
            }
            if (imageUrl != null) {
                object.setImageUrls(Arrays.asList(imageUrl));
            }
            if (url != null) {
                object.setUrl(url);
            }
            if (description != null) {
                object.setDescription(description);
            }

            object.setCreateObject(true);
            object.setData(GraphObject.Factory.create());

            return object;
        }
    }
}




Java Source Code List

com.example.bagofpix.CreateStory.java
com.example.bagofpix.DBHandler.java
com.example.bagofpix.DBReader.java
com.example.bagofpix.ImportPhoto.java
com.example.bagofpix.MainActivity.java
com.example.bagofpix.Photo.java
com.example.bagofpix.Story.java
com.example.bagofpix.ViewStory.java
com.facebook.AccessTokenSource.java
com.facebook.AccessToken.java
com.facebook.AppEventsConstants.java
com.facebook.AppEventsLogger.java
com.facebook.AppLinkData.java
com.facebook.AuthorizationClient.java
com.facebook.FacebookAuthorizationException.java
com.facebook.FacebookDialogException.java
com.facebook.FacebookException.java
com.facebook.FacebookGraphObjectException.java
com.facebook.FacebookOperationCanceledException.java
com.facebook.FacebookRequestError.java
com.facebook.FacebookSdkVersion.java
com.facebook.FacebookServiceException.java
com.facebook.GetTokenClient.java
com.facebook.HttpMethod.java
com.facebook.InsightsLogger.java
com.facebook.LegacyHelper.java
com.facebook.LoggingBehavior.java
com.facebook.LoginActivity.java
com.facebook.NativeAppCallAttachmentStore.java
com.facebook.NativeAppCallContentProvider.java
com.facebook.NonCachingTokenCachingStrategy.java
com.facebook.RequestAsyncTask.java
com.facebook.RequestBatch.java
com.facebook.Request.java
com.facebook.Response.java
com.facebook.SessionDefaultAudience.java
com.facebook.SessionLoginBehavior.java
com.facebook.SessionState.java
com.facebook.Session.java
com.facebook.Settings.java
com.facebook.SharedPreferencesTokenCachingStrategy.java
com.facebook.TestSession.java
com.facebook.TokenCachingStrategy.java
com.facebook.UiLifecycleHelper.java
com.facebook.android.AsyncFacebookRunner.java
com.facebook.android.DialogError.java
com.facebook.android.FacebookError.java
com.facebook.android.Facebook.java
com.facebook.android.FbDialog.java
com.facebook.android.Util.java
com.facebook.internal.AnalyticsEvents.java
com.facebook.internal.CacheableRequestBatch.java
com.facebook.internal.FileLruCache.java
com.facebook.internal.ImageDownloader.java
com.facebook.internal.ImageRequest.java
com.facebook.internal.ImageResponseCache.java
com.facebook.internal.ImageResponse.java
com.facebook.internal.Logger.java
com.facebook.internal.NativeProtocol.java
com.facebook.internal.PlatformServiceClient.java
com.facebook.internal.ServerProtocol.java
com.facebook.internal.SessionAuthorizationType.java
com.facebook.internal.SessionTracker.java
com.facebook.internal.UrlRedirectCache.java
com.facebook.internal.Utility.java
com.facebook.internal.Validate.java
com.facebook.internal.WorkQueue.java
com.facebook.internal.package-info.java
com.facebook.model.CreateGraphObject.java
com.facebook.model.GraphLocation.java
com.facebook.model.GraphMultiResult.java
com.facebook.model.GraphObjectList.java
com.facebook.model.GraphObject.java
com.facebook.model.GraphPlace.java
com.facebook.model.GraphUser.java
com.facebook.model.JsonUtil.java
com.facebook.model.OpenGraphAction.java
com.facebook.model.OpenGraphObject.java
com.facebook.model.PropertyName.java
com.facebook.widget.FacebookDialog.java
com.facebook.widget.FacebookFragment.java
com.facebook.widget.FriendPickerFragment.java
com.facebook.widget.GraphObjectAdapter.java
com.facebook.widget.GraphObjectCursor.java
com.facebook.widget.GraphObjectPagingLoader.java
com.facebook.widget.LoginButton.java
com.facebook.widget.PickerFragment.java
com.facebook.widget.PlacePickerFragment.java
com.facebook.widget.ProfilePictureView.java
com.facebook.widget.SimpleGraphObjectCursor.java
com.facebook.widget.UserSettingsFragment.java
com.facebook.widget.WebDialog.java