パッケージ twitter4j

クラス TwitterObjectFactory

java.lang.Object
twitter4j.TwitterObjectFactory

public final class TwitterObjectFactory extends Object
導入されたバージョン:
Twitter4J 4.0.0
  • メソッドの詳細

    • getRawJSON

      public static String getRawJSON(Object obj)
      Returns a raw JSON form of the provided object.
      Note that raw JSON forms can be retrieved only from the same thread invoked the last method call and will become inaccessible once another method call
      パラメータ:
      obj - target object to retrieve JSON
      戻り値:
      raw JSON
      導入されたバージョン:
      Twitter4J 2.1.7
    • createStatus

      public static Status createStatus(String rawJSON) throws TwitterException
      Constructs a Status object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      Status
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createUser

      public static User createUser(String rawJSON) throws TwitterException
      Constructs a User object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      User
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createAccountTotals

      public static AccountTotals createAccountTotals(String rawJSON) throws TwitterException
      Constructs an AccountTotals object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      AccountTotals
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.9
    • createRelationship

      public static Relationship createRelationship(String rawJSON) throws TwitterException
      Constructs a Relationship object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      Relationship
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createPlace

      public static Place createPlace(String rawJSON) throws TwitterException
      Constructs a Place object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      Place
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createSavedSearch

      public static SavedSearch createSavedSearch(String rawJSON) throws TwitterException
      Constructs a SavedSearch object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      SavedSearch
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createTrend

      public static Trend createTrend(String rawJSON) throws TwitterException
      Constructs a Trend object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      Trend
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createTrends

      public static Trends createTrends(String rawJSON) throws TwitterException
      Constructs a Trends object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      Trends
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createIDs

      public static IDs createIDs(String rawJSON) throws TwitterException
      Constructs a IDs object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      IDs
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createRateLimitStatus

      public static Map<String,RateLimitStatus> createRateLimitStatus(String rawJSON) throws TwitterException
      Constructs a RateLimitStatus object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      RateLimitStatus
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createDirectMessage

      public static DirectMessage createDirectMessage(String rawJSON) throws TwitterException
      Constructs a DirectMessage object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      DirectMessage
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createLocation

      public static Location createLocation(String rawJSON) throws TwitterException
      Constructs a Location object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      Location
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createUserList

      public static UserList createUserList(String rawJSON) throws TwitterException
      Constructs a UserList object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      UserList
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.7
    • createOEmbed

      public static OEmbed createOEmbed(String rawJSON) throws TwitterException
      Constructs an OEmbed object from rawJSON string.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      OEmbed
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 3.0.2
    • createObject

      public static Object createObject(String rawJSON) throws TwitterException
      Construct an object from rawJSON string. This method may be called when you do not know what a given raw JSON string contains. It will do the work of determining what type of object the JSON represents, and constructing the respective object type. For example, if the JSON contents represents a Status, then a Status will be returned. If it represents a deletion notice, then a StatusDeletionNotice will be returned. The caller can simply use instanceof to handle the returned object as applicable. NOTE: the raw JSONObject will be returned in cases where there isn't a discrete respective object type that can be constructed. That way, the caller can at least have access to the JSON itself.
      パラメータ:
      rawJSON - raw JSON form as String
      戻り値:
      the respective constructed object, or the JSONObject in the case where we cannot determine the object type.
      例外:
      TwitterException - when provided string is not a valid JSON string.
      導入されたバージョン:
      Twitter4J 2.1.9