Class SimulatedStatus

  • All Implemented Interfaces:
    Serializable, Comparable<twitter4j.Status>, twitter4j.EntitySupport, twitter4j.Status, twitter4j.TwitterResponse

    public class SimulatedStatus
    extends AbstractSimulatedTwitterResponse
    implements twitter4j.Status
    For simulating tweets without using Twitter.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SimulatedStatus()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(twitter4j.Status o)
      Compares this status with the other one.
      long[] getContributors()
      Returns an array of contributors, or null if no contributor is associated with this status.
      Date getCreatedAt()
      Return the created_at
      long getCurrentUserRetweetId()
      Returns the authenticating user's retweet's id of this tweet, or -1L when the tweet was created before this feature was enabled.
      int getDisplayTextRangeEnd()  
      int getDisplayTextRangeStart()  
      int getFavoriteCount()
      Indicates approximately how many times this Tweet has been "favorited" by Twitter users.
      twitter4j.GeoLocation getGeoLocation()
      Returns The location that this tweet refers to if available.
      twitter4j.HashtagEntity[] getHashtagEntities()
      Returns an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
      long getId()
      Returns the id of the status
      String getInReplyToScreenName()
      Returns the in_reply_to_screen_name
      long getInReplyToStatusId()
      Returns the in_reply_tostatus_id
      long getInReplyToUserId()
      Returns the in_reply_user_id
      String getLang()
      Returns the lang of the status text if available.
      twitter4j.MediaEntity[] getMediaEntities()
      Returns an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
      twitter4j.Place getPlace()
      Returns the place attached to this status
      twitter4j.Status getQuotedStatus()
      Returns the Tweet object of the original Tweet that was quoted.
      long getQuotedStatusId()
      Returns the Tweet ID of the quoted Tweet
      int getRetweetCount()
      Returns the number of times this tweet has been retweeted, or -1 when the tweet was created before this feature was enabled.
      twitter4j.Status getRetweetedStatus()
      The retweeted status.
      twitter4j.Scopes getScopes()
      Returns the targeting scopes applied to a status.
      String getSource()
      Returns the source
      twitter4j.SymbolEntity[] getSymbolEntities()
      Returns an array of SymbolEntities if medias are available in the tweet.
      String getText()
      Returns the text of the status
      twitter4j.URLEntity[] getURLEntities()
      Returns an array if URLEntity mentioned in the tweet, or null if no URLs were mentioned.
      twitter4j.User getUser()
      Return the user associated with the status.
      This can be null if the instance if from User.getStatus().
      twitter4j.UserMentionEntity[] getUserMentionEntities()
      Returns an array of user mentions in the tweet, or null if no users were mentioned.
      String[] getWithheldInCountries()
      Returns the list of country codes where the tweet is withheld
      protected void initialize()
      Initializes the members.
      boolean isFavorited()
      Test if the status is favorited
      boolean isPossiblySensitive()
      Returns true if the status contains a link that is identified as sensitive.
      boolean isRetweet()
      Whether it is a retweet.
      boolean isRetweeted()
      Test if the status is retweeted
      boolean isRetweetedByMe()
      Returns true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.
      boolean isTruncated()
      Test if the status is truncated
      void setContributors​(long[] value)
      Sets an array of contributors, or null if no contributor is associated with this status.
      void setCreatedAt​(Date value)
      Sets the created_at
      void setCurrentUserRetweetId​(long value)
      Sets the authenticating user's retweet's id of this tweet, or -1L when the tweet was created before this feature was enabled.
      void setFavoriteCount​(int value)
      Sets how many times this tweet has been "favorited" by twitter users.
      void setFavorited​(boolean value)
      Sets if the status is favorited
      void setGeoLocation​(twitter4j.GeoLocation value)
      Sets The location that this tweet refers to if available.
      void setHashtagEntities​(twitter4j.HashtagEntity[] value)
      Sets an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
      void setId​(long value)
      Sets the id of the status
      void setInReplyToScreenName​(String value)
      Sets the in_reply_to_screen_name
      void setInReplyToStatusId​(long value)
      Sets the in_reply_tostatus_id
      void setInReplyToUserId​(long value)
      Sets the in_reply_user_id
      void setIsRetweeted​(boolean value)
      Sets whether the status is retweeted.
      void setLang​(String value)
      Sets the lang of the status text if available.
      void setMediaEntities​(twitter4j.MediaEntity[] value)
      Sets an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
      void setPlace​(twitter4j.Place value)
      Sets the place attached to this status
      void setPossiblySensitive​(boolean value)
      Set true if the status contains a link that is identified as sensitive.
      void setQuotedStatus​(twitter4j.Status value)
      Sets the Tweet object of the original Tweet that was quoted.
      void setQuotedStatusId​(long value)
      Sets the Tweet ID of the quoted Tweet
      void setRetweet​(boolean value)
      Sets whether it is a retweet.
      void setRetweetCount​(int value)
      Sets the number of times this tweet has been retweeted, or -1 when the tweet was created before this feature was enabled.
      void setRetweetedByMe​(boolean value)
      Set true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.
      void setRetweetedStatus​(twitter4j.Status value)
      Sets the retweeted status.
      void setScopes​(twitter4j.Scopes value)
      Sets the targeting scopes applied to a status.
      void setSource​(String value)
      Sets the source
      void setSymbolEntities​(twitter4j.SymbolEntity[] value)
      Sets an array of SymbolEntities if medias are available in the tweet.
      void setText​(String value)
      Sets the text of the status
      void setTruncated​(boolean value)
      Set if the status is truncated
      void setURLEntities​(twitter4j.URLEntity[] value)
      Sets an array if URLEntity mentioned in the tweet, or null if no URLs were mentioned.
      void setUser​(twitter4j.User value)
      Sets the user associated with the status.
      This can be null if the instance if from User.getStatus().
      void setUserMentionEntities​(twitter4j.UserMentionEntity[] value)
      Sets an array of user mentions in the tweet, or null if no users were mentioned.
      void setWithheldInCountries​(String[] value)
      Sets the list of country codes where the tweet is withheld
      String toString()
      Returns a short string describing the tweet (ID + text).
      • Methods inherited from interface twitter4j.TwitterResponse

        getAccessLevel, getRateLimitStatus
    • Field Detail

      • m_UserMentionEntity

        protected twitter4j.UserMentionEntity[] m_UserMentionEntity
        the user mention entities.
      • m_URLEntity

        protected twitter4j.URLEntity[] m_URLEntity
        the URL entities.
      • m_HashtagEntity

        protected twitter4j.HashtagEntity[] m_HashtagEntity
        the hashtag entities.
      • m_MediaEntity

        protected twitter4j.MediaEntity[] m_MediaEntity
        the media entities.
      • m_CreatedAt

        protected Date m_CreatedAt
        the CreatedAt.
      • m_Id

        protected long m_Id
        the ID.
      • m_Text

        protected String m_Text
        the tweet text.
      • m_Source

        protected String m_Source
        the source.
      • m_Truncated

        protected boolean m_Truncated
        whether the tweet got truncated.
      • m_InReplyToStatusId

        protected long m_InReplyToStatusId
        the in-reply-to status ID.
      • m_InReplyToUserId

        protected long m_InReplyToUserId
        the in-reply-to user ID.
      • m_InReplyToScreenName

        protected String m_InReplyToScreenName
        the in-reply-to screen name.
      • m_GeoLocation

        protected twitter4j.GeoLocation m_GeoLocation
        the geo location.
      • m_Place

        protected twitter4j.Place m_Place
        the place.
      • m_Favorited

        protected boolean m_Favorited
        whether tweet got favorited.
      • m_User

        protected twitter4j.User m_User
        the associated user.
      • m_Retweet

        protected boolean m_Retweet
        whether it is a retweet.
      • m_RetweetedStatus

        protected twitter4j.Status m_RetweetedStatus
        the retweeted status.
      • m_Contributors

        protected long[] m_Contributors
        the contributors.
      • m_RetweetCount

        protected int m_RetweetCount
        the retweet count.
      • m_RetweetedByMe

        protected boolean m_RetweetedByMe
        whether it was retweeted by me.
      • m_CurrentUserRetweetId

        protected long m_CurrentUserRetweetId
        the current user's retweet id.
      • m_PossiblySensitive

        protected boolean m_PossiblySensitive
        whether the tweet is potentially sensitive.
      • m_SymbolEntities

        protected twitter4j.SymbolEntity[] m_SymbolEntities
      • m_IsRetweeted

        protected boolean m_IsRetweeted
        whether retweeted or not.
      • m_FavoriteCount

        protected int m_FavoriteCount
        the favorite count.
      • m_Lang

        protected String m_Lang
        the language.
      • m_Scopes

        protected twitter4j.Scopes m_Scopes
        the scopes.
      • m_WithheldInCountries

        protected String[] m_WithheldInCountries
        the countries in which withheld.
      • m_QuotedStatusId

        protected long m_QuotedStatusId
        the ID of the quoted status.
      • m_QuotedStatus

        protected twitter4j.Status m_QuotedStatus
        the quoted status.
    • Constructor Detail

      • SimulatedStatus

        public SimulatedStatus()
    • Method Detail

      • compareTo

        public int compareTo​(twitter4j.Status o)
        Compares this status with the other one. Uses: m_Id, m_Text, m_Source
        Specified by:
        compareTo in interface Comparable<twitter4j.Status>
        Parameters:
        o - the status to compare with
        Returns:
        less than 0, equal to 0, greater than 0 if this status is less, equal or larger than the other one
      • setUserMentionEntities

        public void setUserMentionEntities​(twitter4j.UserMentionEntity[] value)
        Sets an array of user mentions in the tweet, or null if no users were mentioned.
        Parameters:
        value - An array of user mention entities in the tweet.
      • getUserMentionEntities

        public twitter4j.UserMentionEntity[] getUserMentionEntities()
        Returns an array of user mentions in the tweet, or null if no users were mentioned.
        Specified by:
        getUserMentionEntities in interface twitter4j.EntitySupport
        Returns:
        An array of user mention entities in the tweet.
      • setURLEntities

        public void setURLEntities​(twitter4j.URLEntity[] value)
        Sets an array if URLEntity mentioned in the tweet, or null if no URLs were mentioned.
        Parameters:
        value - An array of URLEntity mentioned in the tweet.
      • getURLEntities

        public twitter4j.URLEntity[] getURLEntities()
        Returns an array if URLEntity mentioned in the tweet, or null if no URLs were mentioned.
        Specified by:
        getURLEntities in interface twitter4j.EntitySupport
        Returns:
        An array of URLEntity mentioned in the tweet.
      • setHashtagEntities

        public void setHashtagEntities​(twitter4j.HashtagEntity[] value)
        Sets an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
        Parameters:
        value - an array of MediaEntities.
      • getHashtagEntities

        public twitter4j.HashtagEntity[] getHashtagEntities()
        Returns an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
        Specified by:
        getHashtagEntities in interface twitter4j.EntitySupport
        Returns:
        an array of MediaEntities.
      • setMediaEntities

        public void setMediaEntities​(twitter4j.MediaEntity[] value)
        Sets an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
        Parameters:
        value - an array of MediaEntities.
      • getMediaEntities

        public twitter4j.MediaEntity[] getMediaEntities()
        Returns an array of MediaEntities if medias are available in the tweet, or null if no media is included in the tweet.
        Specified by:
        getMediaEntities in interface twitter4j.EntitySupport
        Returns:
        an array of MediaEntities.
      • setCreatedAt

        public void setCreatedAt​(Date value)
        Sets the created_at
        Parameters:
        value - created_at
      • getCreatedAt

        public Date getCreatedAt()
        Return the created_at
        Specified by:
        getCreatedAt in interface twitter4j.Status
        Returns:
        created_at
      • setId

        public void setId​(long value)
        Sets the id of the status
        Parameters:
        value - the id
      • getId

        public long getId()
        Returns the id of the status
        Specified by:
        getId in interface twitter4j.Status
        Returns:
        the id
      • setText

        public void setText​(String value)
        Sets the text of the status
        Parameters:
        value - the text
      • getText

        public String getText()
        Returns the text of the status
        Specified by:
        getText in interface twitter4j.Status
        Returns:
        the text
      • getDisplayTextRangeStart

        public int getDisplayTextRangeStart()
        Specified by:
        getDisplayTextRangeStart in interface twitter4j.Status
      • getDisplayTextRangeEnd

        public int getDisplayTextRangeEnd()
        Specified by:
        getDisplayTextRangeEnd in interface twitter4j.Status
      • setSource

        public void setSource​(String value)
        Sets the source
        Parameters:
        value - the source
      • getSource

        public String getSource()
        Returns the source
        Specified by:
        getSource in interface twitter4j.Status
        Returns:
        the source
      • setTruncated

        public void setTruncated​(boolean value)
        Set if the status is truncated
        Parameters:
        value - true if truncated
      • isTruncated

        public boolean isTruncated()
        Test if the status is truncated
        Specified by:
        isTruncated in interface twitter4j.Status
        Returns:
        true if truncated
      • setInReplyToStatusId

        public void setInReplyToStatusId​(long value)
        Sets the in_reply_tostatus_id
        Parameters:
        value - the in_reply_tostatus_id
      • getInReplyToStatusId

        public long getInReplyToStatusId()
        Returns the in_reply_tostatus_id
        Specified by:
        getInReplyToStatusId in interface twitter4j.Status
        Returns:
        the in_reply_tostatus_id
      • setInReplyToUserId

        public void setInReplyToUserId​(long value)
        Sets the in_reply_user_id
        Parameters:
        value - the in_reply_tostatus_id
      • getInReplyToUserId

        public long getInReplyToUserId()
        Returns the in_reply_user_id
        Specified by:
        getInReplyToUserId in interface twitter4j.Status
        Returns:
        the in_reply_tostatus_id
      • setInReplyToScreenName

        public void setInReplyToScreenName​(String value)
        Sets the in_reply_to_screen_name
        Parameters:
        value - the in_in_reply_to_screen_name
      • getInReplyToScreenName

        public String getInReplyToScreenName()
        Returns the in_reply_to_screen_name
        Specified by:
        getInReplyToScreenName in interface twitter4j.Status
        Returns:
        the in_in_reply_to_screen_name
      • setGeoLocation

        public void setGeoLocation​(twitter4j.GeoLocation value)
        Sets The location that this tweet refers to if available.
        Parameters:
        value - The location that this tweet refers to if available (can be null)
      • getGeoLocation

        public twitter4j.GeoLocation getGeoLocation()
        Returns The location that this tweet refers to if available.
        Specified by:
        getGeoLocation in interface twitter4j.Status
        Returns:
        returns The location that this tweet refers to if available (can be null)
      • setPlace

        public void setPlace​(twitter4j.Place value)
        Sets the place attached to this status
        Parameters:
        value - The place attached to this status
      • getPlace

        public twitter4j.Place getPlace()
        Returns the place attached to this status
        Specified by:
        getPlace in interface twitter4j.Status
        Returns:
        The place attached to this status
      • setFavorited

        public void setFavorited​(boolean value)
        Sets if the status is favorited
        Parameters:
        value - true if favorited
      • isFavorited

        public boolean isFavorited()
        Test if the status is favorited
        Specified by:
        isFavorited in interface twitter4j.Status
        Returns:
        true if favorited
      • setUser

        public void setUser​(twitter4j.User value)
        Sets the user associated with the status.
        This can be null if the instance if from User.getStatus().
        Parameters:
        value - the user
      • getUser

        public twitter4j.User getUser()
        Return the user associated with the status.
        This can be null if the instance if from User.getStatus().
        Specified by:
        getUser in interface twitter4j.Status
        Returns:
        the user
      • setRetweet

        public void setRetweet​(boolean value)
        Sets whether it is a retweet.
      • isRetweet

        public boolean isRetweet()
        Whether it is a retweet.
        Specified by:
        isRetweet in interface twitter4j.Status
      • getRetweetedStatus

        public twitter4j.Status getRetweetedStatus()
        The retweeted status.
        Specified by:
        getRetweetedStatus in interface twitter4j.Status
      • setRetweetedStatus

        public void setRetweetedStatus​(twitter4j.Status value)
        Sets the retweeted status.
      • setContributors

        public void setContributors​(long[] value)
        Sets an array of contributors, or null if no contributor is associated with this status.
      • getContributors

        public long[] getContributors()
        Returns an array of contributors, or null if no contributor is associated with this status.
        Specified by:
        getContributors in interface twitter4j.Status
      • setRetweetCount

        public void setRetweetCount​(int value)
        Sets the number of times this tweet has been retweeted, or -1 when the tweet was created before this feature was enabled.
        Parameters:
        value - the retweet count.
      • getRetweetCount

        public int getRetweetCount()
        Returns the number of times this tweet has been retweeted, or -1 when the tweet was created before this feature was enabled.
        Specified by:
        getRetweetCount in interface twitter4j.Status
        Returns:
        the retweet count.
      • setRetweetedByMe

        public void setRetweetedByMe​(boolean value)
        Set true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.
        Parameters:
        value - whether the authenticating user has retweeted this tweet.
      • isRetweetedByMe

        public boolean isRetweetedByMe()
        Returns true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.
        Specified by:
        isRetweetedByMe in interface twitter4j.Status
        Returns:
        whether the authenticating user has retweeted this tweet.
      • setCurrentUserRetweetId

        public void setCurrentUserRetweetId​(long value)
        Sets the authenticating user's retweet's id of this tweet, or -1L when the tweet was created before this feature was enabled.
        Parameters:
        value - the authenticating user's retweet's id of this tweet
      • getCurrentUserRetweetId

        public long getCurrentUserRetweetId()
        Returns the authenticating user's retweet's id of this tweet, or -1L when the tweet was created before this feature was enabled.
        Specified by:
        getCurrentUserRetweetId in interface twitter4j.Status
        Returns:
        the authenticating user's retweet's id of this tweet
      • setPossiblySensitive

        public void setPossiblySensitive​(boolean value)
        Set true if the status contains a link that is identified as sensitive.
        Parameters:
        value - whether the status contains sensitive links
      • isPossiblySensitive

        public boolean isPossiblySensitive()
        Returns true if the status contains a link that is identified as sensitive.
        Specified by:
        isPossiblySensitive in interface twitter4j.Status
        Returns:
        whether the status contains sensitive links
      • setSymbolEntities

        public void setSymbolEntities​(twitter4j.SymbolEntity[] value)
        Sets an array of SymbolEntities if medias are available in the tweet.
        Parameters:
        value - an array of SymbolEntities.
      • getSymbolEntities

        public twitter4j.SymbolEntity[] getSymbolEntities()
        Returns an array of SymbolEntities if medias are available in the tweet. This method will an empty array if no symbols were mentioned.
        Specified by:
        getSymbolEntities in interface twitter4j.EntitySupport
        Returns:
        an array of SymbolEntities.
      • setIsRetweeted

        public void setIsRetweeted​(boolean value)
        Sets whether the status is retweeted.
        Parameters:
        value - true if retweeted
      • isRetweeted

        public boolean isRetweeted()
        Test if the status is retweeted
        Specified by:
        isRetweeted in interface twitter4j.Status
        Returns:
        true if retweeted
      • setFavoriteCount

        public void setFavoriteCount​(int value)
        Sets how many times this tweet has been "favorited" by twitter users.
        Parameters:
        value - the count
      • getFavoriteCount

        public int getFavoriteCount()
        Indicates approximately how many times this Tweet has been "favorited" by Twitter users.
        Specified by:
        getFavoriteCount in interface twitter4j.Status
        Returns:
        the favorite count
      • setLang

        public void setLang​(String value)
        Sets the lang of the status text if available.
        Parameters:
        value - the language
      • getLang

        public String getLang()
        Returns the lang of the status text if available.
        Specified by:
        getLang in interface twitter4j.Status
        Returns:
        two-letter iso language code
      • setScopes

        public void setScopes​(twitter4j.Scopes value)
        Sets the targeting scopes applied to a status.
        Parameters:
        value - the scopes
      • getScopes

        public twitter4j.Scopes getScopes()
        Returns the targeting scopes applied to a status.
        Specified by:
        getScopes in interface twitter4j.Status
        Returns:
        the targeting scopes applied to a status.
      • setWithheldInCountries

        public void setWithheldInCountries​(String[] value)
        Sets the list of country codes where the tweet is withheld
        Parameters:
        value - list of country codes where the tweet is withheld - null if not withheld
      • getWithheldInCountries

        public String[] getWithheldInCountries()
        Returns the list of country codes where the tweet is withheld
        Specified by:
        getWithheldInCountries in interface twitter4j.Status
        Returns:
        list of country codes where the tweet is withheld - null if not withheld
      • setQuotedStatusId

        public void setQuotedStatusId​(long value)
        Sets the Tweet ID of the quoted Tweet
      • getQuotedStatusId

        public long getQuotedStatusId()
        Returns the Tweet ID of the quoted Tweet
        Specified by:
        getQuotedStatusId in interface twitter4j.Status
        Returns:
        the Tweet ID of the quoted Tweet
      • setQuotedStatus

        public void setQuotedStatus​(twitter4j.Status value)
        Sets the Tweet object of the original Tweet that was quoted.
        Parameters:
        value - the quoted Tweet object
      • getQuotedStatus

        public twitter4j.Status getQuotedStatus()
        Returns the Tweet object of the original Tweet that was quoted.
        Specified by:
        getQuotedStatus in interface twitter4j.Status
        Returns:
        the quoted Tweet object
      • toString

        public String toString()
        Returns a short string describing the tweet (ID + text).
        Overrides:
        toString in class Object
        Returns:
        the string representation