facebook4j
Class FacebookFactory

java.lang.Object
  extended by facebook4j.FacebookFactory
All Implemented Interfaces:
Serializable

public final class FacebookFactory
extends Object
implements Serializable

A factory class for Facebook.
An instance of this class is completely thread safe and can be re-used and used concurrently.

Since:
Twitter4J 2.1.0
Author:
Yusuke Yamamoto - yusuke at mac.com, Ryuji Yamashita - roundrop at gmail.com
See Also:
Serialized Form

Constructor Summary
FacebookFactory()
          Creates a FacebookFactory with the root configuration.
FacebookFactory(Configuration conf)
          Creates a FacebookFactory with the given configuration.
FacebookFactory(String configTreePath)
          Creates a FacebookFactory with a specified config tree
 
Method Summary
 Facebook getInstance()
          Returns a instance associated with the configuration bound to this factory.
 Facebook getInstance(AccessToken accessToken)
          Returns a OAuth Authenticated instance.
app Id and app Secret must be provided by facebook4j.properties, or system properties.
Unlike OAuthSupport.setOAuthAccessToken(facebook4j.auth.AccessToken), this factory method potentially returns a cached instance.
 Facebook getInstance(Authorization auth)
           
static Facebook getSingleton()
          Returns default singleton Facebook instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacebookFactory

public FacebookFactory()
Creates a FacebookFactory with the root configuration.


FacebookFactory

public FacebookFactory(Configuration conf)
Creates a FacebookFactory with the given configuration.

Parameters:
conf - the configuration to use
Since:
Twitter4J 2.1.1

FacebookFactory

public FacebookFactory(String configTreePath)
Creates a FacebookFactory with a specified config tree

Parameters:
configTreePath - the path
Method Detail

getInstance

public Facebook getInstance()
Returns a instance associated with the configuration bound to this factory.

Returns:
default singleton instance

getInstance

public Facebook getInstance(AccessToken accessToken)
Returns a OAuth Authenticated instance.
app Id and app Secret must be provided by facebook4j.properties, or system properties.
Unlike OAuthSupport.setOAuthAccessToken(facebook4j.auth.AccessToken), this factory method potentially returns a cached instance.

Parameters:
accessToken - access token
Returns:
an instance
Since:
Twitter4J 2.1.9

getInstance

public Facebook getInstance(Authorization auth)

getSingleton

public static Facebook getSingleton()
Returns default singleton Facebook instance.

Returns:
default singleton Facebook instance
Since:
Twitter4J 2.2.4


Copyright © 2019. All rights reserved.