twitter4j
Class TwitterFactory

java.lang.Object
  extended by twitter4j.TwitterFactory
All Implemented Interfaces:
java.io.Serializable

public final class TwitterFactory
extends java.lang.Object
implements java.io.Serializable

A factory class for Twitter.
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
See Also:
Serialized Form

Constructor Summary
TwitterFactory()
          Creates a TwitterFactory with the root configuration.
TwitterFactory(Configuration conf)
          Creates a TwitterFactory with the given configuration.
TwitterFactory(java.lang.String configTreePath)
          Creates a TwitterFactory with a specified config tree
 
Method Summary
 Twitter getInstance()
          Returns a instance.
 Twitter getInstance(AccessToken accessToken)
          Returns a OAuth Authenticated instance.
consumer key and consumer Secret must be provided by twitter4j.properties, or system properties.
Unlike OAuthSupport.setOAuthAccessToken(twitter4j.auth.AccessToken), this factory method potentially returns a cached instance.
 Twitter getInstance(Authorization auth)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwitterFactory

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


TwitterFactory

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

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

TwitterFactory

public TwitterFactory(java.lang.String configTreePath)
Creates a TwitterFactory with a specified config tree

Parameters:
configTreePath - the path
Method Detail

getInstance

public Twitter getInstance()
Returns a instance.

Returns:
default singleton instance

getInstance

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

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

getInstance

public Twitter getInstance(Authorization auth)


Copyright © 2011. All Rights Reserved.