Package net.datafaker.providers.base
Class Twitter
Creates fake Twitter messages.
- Since:
- 0.9.0
-
Field Summary
Fields inherited from class net.datafaker.providers.base.AbstractProvider
faker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreatedTime
(boolean forward, Date base, Date constrains) Used to fake a new Twitter Date.return a fake link to a Twitter message.To fake a new text context for the Twitter.twitterId
(int expectedLength) Used to fake a new Twitter ID without collision using both current time and uuid as seeds.userId()
userName()
-
Constructor Details
-
Twitter
- Parameters:
faker
- used as constructor
-
-
Method Details
-
createdTime
Used to fake a new Twitter Date.- Parameters:
forward
- to determined if the returned date is later (or before) the given date.base
- the base date given as a start point.constrains
- used to constrain the returned date range.- Returns:
- a new date later (or before) the base date with respect to the constraint (no later/earlier than the constrain).
-
twitterId
Used to fake a new Twitter ID without collision using both current time and uuid as seeds.- Parameters:
expectedLength
- the expected length of the twitter id. Should be greater or equals to 6 and less than or equals to 25.- Returns:
- a new Twitter ID consists of purely numbers.
-
text
To fake a new text context for the Twitter.- Parameters:
keywords
- the keywords that you wish to appear in the text.sentenceMaxLength
- the text should be in range of the sentence max length.wordMaxLength
- each word should be in range of the word max length.- Returns:
- a new fake text for the Twitter.
-
userName
- Returns:
- Return a user name using the twitter.user_name.
-
userId
- Returns:
- Return a user id using the twitter.user_name.
-
getLink
return a fake link to a Twitter message. The extra length is expected to be larger than 4.- Parameters:
username
- the username will be used in the link.extraLength
- the expected length of the extra link part.- Returns:
- return a fake link to a Twitter message.
-