Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TFJ-446

migrate to Apache License 2.0
  • Loading branch information...
commit b534c834f13dab5069f6fdba3fdcc9a746609bff 1 parent 4f56acc
@yusuke authored
Showing with 6,871 additions and 9,152 deletions.
  1. +179 −26 LICENSE.txt
  2. +15 −25 twitter4j-core/src/main/java/twitter4j/AbstractStreamImplementation.java
  3. +23 −25 twitter4j-core/src/main/java/twitter4j/AccountSettings.java
  4. +15 −25 twitter4j-core/src/main/java/twitter4j/AccountSettingsJSONImpl.java
  5. +14 −26 twitter4j-core/src/main/java/twitter4j/AccountTotals.java
  6. +16 −25 twitter4j-core/src/main/java/twitter4j/AccountTotalsJSONImpl.java
  7. +195 −194 twitter4j-core/src/main/java/twitter4j/Annotation.java
  8. +121 −125 twitter4j-core/src/main/java/twitter4j/Annotations.java
  9. +15 −25 twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java
  10. +14 −24 twitter4j-core/src/main/java/twitter4j/AsyncTwitterFactory.java
  11. +16 −24 twitter4j-core/src/main/java/twitter4j/Category.java
  12. +15 −26 twitter4j-core/src/main/java/twitter4j/CategoryJSONImpl.java
  13. +14 −24 twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java
  14. +14 −29 twitter4j-core/src/main/java/twitter4j/CursorSupport.java
  15. +17 −25 twitter4j-core/src/main/java/twitter4j/DirectMessage.java
  16. +28 −29 twitter4j-core/src/main/java/twitter4j/DirectMessageJSONImpl.java
  17. +23 −31 twitter4j-core/src/main/java/twitter4j/ExceptionDiagnosis.java
  18. +15 −25 twitter4j-core/src/main/java/twitter4j/FilterQuery.java
  19. +18 −24 twitter4j-core/src/main/java/twitter4j/Friendship.java
  20. +17 −26 twitter4j-core/src/main/java/twitter4j/FriendshipJSONImpl.java
  21. +14 −24 twitter4j-core/src/main/java/twitter4j/GeoLocation.java
  22. +29 −31 twitter4j-core/src/main/java/twitter4j/GeoQuery.java
  23. +15 −25 twitter4j-core/src/main/java/twitter4j/HashtagEntity.java
  24. +16 −25 twitter4j-core/src/main/java/twitter4j/HashtagEntityJSONImpl.java
  25. +14 −24 twitter4j-core/src/main/java/twitter4j/IDs.java
  26. +15 −25 twitter4j-core/src/main/java/twitter4j/IDsJSONImpl.java
  27. +21 −25 twitter4j-core/src/main/java/twitter4j/Location.java
  28. +19 −27 twitter4j-core/src/main/java/twitter4j/LocationJSONImpl.java
  29. +14 −24 twitter4j-core/src/main/java/twitter4j/PagableResponseList.java
  30. +14 −24 twitter4j-core/src/main/java/twitter4j/PagableResponseListImpl.java
  31. +25 −31 twitter4j-core/src/main/java/twitter4j/Paging.java
  32. +63 −56 twitter4j-core/src/main/java/twitter4j/PlaceJSONImpl.java
  33. +51 −60 twitter4j-core/src/main/java/twitter4j/ProfileImage.java
  34. +14 −24 twitter4j-core/src/main/java/twitter4j/ProfileImageImpl.java
  35. +15 −25 twitter4j-core/src/main/java/twitter4j/Query.java
  36. +16 −25 twitter4j-core/src/main/java/twitter4j/QueryResult.java
  37. +27 −27 twitter4j-core/src/main/java/twitter4j/QueryResultJSONImpl.java
  38. +14 −24 twitter4j-core/src/main/java/twitter4j/RateLimitStatus.java
  39. +17 −26 twitter4j-core/src/main/java/twitter4j/RateLimitStatusEvent.java
  40. +23 −30 twitter4j-core/src/main/java/twitter4j/RateLimitStatusJSONImpl.java
  41. +18 −26 twitter4j-core/src/main/java/twitter4j/RateLimitStatusListener.java
  42. +17 −24 twitter4j-core/src/main/java/twitter4j/RelatedResults.java
  43. +24 −32 twitter4j-core/src/main/java/twitter4j/RelatedResultsJSONImpl.java
  44. +17 −26 twitter4j-core/src/main/java/twitter4j/Relationship.java
  45. +22 −28 twitter4j-core/src/main/java/twitter4j/RelationshipJSONImpl.java
  46. +15 −25 twitter4j-core/src/main/java/twitter4j/ResponseList.java
  47. +14 −24 twitter4j-core/src/main/java/twitter4j/ResponseListImpl.java
  48. +16 −26 twitter4j-core/src/main/java/twitter4j/SavedSearch.java
  49. +27 −32 twitter4j-core/src/main/java/twitter4j/SavedSearchJSONImpl.java
  50. +16 −25 twitter4j-core/src/main/java/twitter4j/SimilarPlaces.java
  51. +17 −25 twitter4j-core/src/main/java/twitter4j/SimilarPlacesImpl.java
  52. +15 −25 twitter4j-core/src/main/java/twitter4j/SiteStreamsAdapter.java
  53. +15 −25 twitter4j-core/src/main/java/twitter4j/SiteStreamsImpl.java
  54. +15 −25 twitter4j-core/src/main/java/twitter4j/SiteStreamsListener.java
  55. +15 −25 twitter4j-core/src/main/java/twitter4j/Status.java
  56. +38 −44 twitter4j-core/src/main/java/twitter4j/StatusAdapter.java
  57. +15 −25 twitter4j-core/src/main/java/twitter4j/StatusDeletionNotice.java
  58. +15 −25 twitter4j-core/src/main/java/twitter4j/StatusDeletionNoticeImpl.java
  59. +15 −25 twitter4j-core/src/main/java/twitter4j/StatusJSONImpl.java
  60. +16 −26 twitter4j-core/src/main/java/twitter4j/StatusListener.java
  61. +16 −25 twitter4j-core/src/main/java/twitter4j/StatusStream.java
  62. +15 −26 twitter4j-core/src/main/java/twitter4j/StatusStreamImpl.java
  63. +48 −56 twitter4j-core/src/main/java/twitter4j/StatusUpdate.java
  64. +14 −24 twitter4j-core/src/main/java/twitter4j/StreamListener.java
  65. +14 −24 twitter4j-core/src/main/java/twitter4j/Trend.java
  66. +16 −26 twitter4j-core/src/main/java/twitter4j/TrendJSONImpl.java
  67. +16 −25 twitter4j-core/src/main/java/twitter4j/Trends.java
  68. +15 −25 twitter4j-core/src/main/java/twitter4j/TrendsJSONImpl.java
  69. +18 −27 twitter4j-core/src/main/java/twitter4j/Tweet.java
  70. +23 −33 twitter4j-core/src/main/java/twitter4j/TweetJSONImpl.java
  71. +15 −25 twitter4j-core/src/main/java/twitter4j/Twitter.java
  72. +159 −84 twitter4j-core/src/main/java/twitter4j/TwitterAdapter.java
  73. +25 −31 twitter4j-core/src/main/java/twitter4j/TwitterBase.java
  74. +15 −25 twitter4j-core/src/main/java/twitter4j/TwitterException.java
  75. +14 −24 twitter4j-core/src/main/java/twitter4j/TwitterFactory.java
  76. +55 −29 twitter4j-core/src/main/java/twitter4j/TwitterListener.java
  77. +16 −26 twitter4j-core/src/main/java/twitter4j/TwitterMethod.java
  78. +15 −25 twitter4j-core/src/main/java/twitter4j/TwitterOAuthSupportBaseImpl.java
  79. +15 −25 twitter4j-core/src/main/java/twitter4j/TwitterResponse.java
  80. +16 −26 twitter4j-core/src/main/java/twitter4j/TwitterResponseImpl.java
  81. +15 −25 twitter4j-core/src/main/java/twitter4j/TwitterStream.java
  82. +14 −24 twitter4j-core/src/main/java/twitter4j/TwitterStreamFactory.java
  83. +14 −24 twitter4j-core/src/main/java/twitter4j/URLEntity.java
  84. +18 −28 twitter4j-core/src/main/java/twitter4j/URLEntityJSONImpl.java
  85. +15 −25 twitter4j-core/src/main/java/twitter4j/User.java
  86. +15 −25 twitter4j-core/src/main/java/twitter4j/UserJSONImpl.java
  87. +14 −24 twitter4j-core/src/main/java/twitter4j/UserList.java
  88. +26 −30 twitter4j-core/src/main/java/twitter4j/UserListJSONImpl.java
  89. +14 −24 twitter4j-core/src/main/java/twitter4j/UserMentionEntity.java
  90. +16 −25 twitter4j-core/src/main/java/twitter4j/UserMentionEntityJSONImpl.java
  91. +16 −25 twitter4j-core/src/main/java/twitter4j/UserStream.java
  92. +15 −25 twitter4j-core/src/main/java/twitter4j/UserStreamAdapter.java
  93. +15 −26 twitter4j-core/src/main/java/twitter4j/UserStreamImpl.java
  94. +15 −25 twitter4j-core/src/main/java/twitter4j/UserStreamListener.java
  95. +14 −24 twitter4j-core/src/main/java/twitter4j/Version.java
  96. +81 −84 twitter4j-core/src/main/java/twitter4j/api/AccountMethods.java
  97. +47 −49 twitter4j-core/src/main/java/twitter4j/api/AccountMethodsAsync.java
  98. +100 −109 twitter4j-core/src/main/java/twitter4j/api/BlockMethods.java
  99. +82 −91 twitter4j-core/src/main/java/twitter4j/api/BlockMethodsAsync.java
  100. +90 −99 twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethods.java
  101. +67 −70 twitter4j-core/src/main/java/twitter4j/api/DirectMessageMethodsAsync.java
  102. +77 −87 twitter4j-core/src/main/java/twitter4j/api/FavoriteMethods.java
  103. +62 −68 twitter4j-core/src/main/java/twitter4j/api/FavoriteMethodsAsync.java
  104. +14 −24 twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethods.java
  105. +14 −24 twitter4j-core/src/main/java/twitter4j/api/FriendsFollowersMethodsAsync.java
  106. +125 −134 twitter4j-core/src/main/java/twitter4j/api/FriendshipMethods.java
  107. +96 −110 twitter4j-core/src/main/java/twitter4j/api/FriendshipMethodsAsync.java
  108. +14 −24 twitter4j-core/src/main/java/twitter4j/api/GeoMethods.java
  109. +14 −24 twitter4j-core/src/main/java/twitter4j/api/GeoMethodsAsync.java
  110. +21 −31 twitter4j-core/src/main/java/twitter4j/api/HelpMethods.java
  111. +21 −31 twitter4j-core/src/main/java/twitter4j/api/HelpMethodsAsync.java
  112. +16 −24 twitter4j-core/src/main/java/twitter4j/api/LegalResources.java
  113. +16 −26 twitter4j-core/src/main/java/twitter4j/api/LegalResourcesAsync.java
  114. +72 −75 twitter4j-core/src/main/java/twitter4j/api/ListMembersMethods.java
  115. +29 −32 twitter4j-core/src/main/java/twitter4j/api/ListMembersMethodsAsync.java
  116. +21 −30 twitter4j-core/src/main/java/twitter4j/api/ListMethods.java
  117. +18 −31 twitter4j-core/src/main/java/twitter4j/api/ListMethodsAsync.java
  118. +56 −62 twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethods.java
  119. +25 −31 twitter4j-core/src/main/java/twitter4j/api/ListSubscribersMethodsAsync.java
  120. +33 −40 twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethods.java
  121. +28 −35 twitter4j-core/src/main/java/twitter4j/api/LocalTrendsMethodsAsync.java
  122. +15 −24 twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethods.java
  123. +15 −24 twitter4j-core/src/main/java/twitter4j/api/NewTwitterMethodsAsync.java
  124. +56 −66 twitter4j-core/src/main/java/twitter4j/api/NotificationMethods.java
  125. +42 −52 twitter4j-core/src/main/java/twitter4j/api/NotificationMethodsAsync.java
  126. +51 −58 twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethods.java
  127. +15 −24 twitter4j-core/src/main/java/twitter4j/api/SavedSearchesMethodsAsync.java
  128. +23 −36 twitter4j-core/src/main/java/twitter4j/api/SearchMethods.java
  129. +23 −35 twitter4j-core/src/main/java/twitter4j/api/SearchMethodsAsync.java
  130. +14 −24 twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethods.java
  131. +16 −27 twitter4j-core/src/main/java/twitter4j/api/SpamReportingMethodsAsync.java
  132. +14 −24 twitter4j-core/src/main/java/twitter4j/api/StatusMethods.java
  133. +14 −24 twitter4j-core/src/main/java/twitter4j/api/StatusMethodsAsync.java
  134. +16 −26 twitter4j-core/src/main/java/twitter4j/api/TimelineMethods.java
  135. +137 −136 twitter4j-core/src/main/java/twitter4j/api/TimelineMethodsAsync.java
  136. +67 −70 twitter4j-core/src/main/java/twitter4j/api/TrendsMethods.java
  137. +30 −33 twitter4j-core/src/main/java/twitter4j/api/TrendsMethodsAsync.java
  138. +15 −25 twitter4j-core/src/main/java/twitter4j/api/UserMethods.java
  139. +15 −25 twitter4j-core/src/main/java/twitter4j/api/UserMethodsAsync.java
  140. +15 −25 twitter4j-core/src/main/java/twitter4j/conf/Configuration.java
  141. +15 −25 twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBase.java
  142. +15 −25 twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBuilder.java
  143. +17 −25 twitter4j-core/src/main/java/twitter4j/conf/ConfigurationContext.java
  144. +16 −24 twitter4j-core/src/main/java/twitter4j/conf/ConfigurationFactory.java
  145. +15 −25 twitter4j-core/src/main/java/twitter4j/conf/PropertyConfiguration.java
  146. +19 −27 twitter4j-core/src/main/java/twitter4j/conf/PropertyConfigurationFactory.java
  147. +23 −33 twitter4j-core/src/main/java/twitter4j/http/AccessToken.java
  148. +15 −24 twitter4j-core/src/main/java/twitter4j/http/Authorization.java
  149. +15 −25 twitter4j-core/src/main/java/twitter4j/http/AuthorizationConfiguration.java
  150. +14 −24 twitter4j-core/src/main/java/twitter4j/http/AuthorizationFactory.java
  151. +15 −25 twitter4j-core/src/main/java/twitter4j/http/BasicAuthorization.java
  152. +14 −24 twitter4j-core/src/main/java/twitter4j/http/NullAuthorization.java
  153. +15 −25 twitter4j-core/src/main/java/twitter4j/http/OAuthAuthorization.java
  154. +22 −31 twitter4j-core/src/main/java/twitter4j/http/OAuthToken.java
  155. +14 −24 twitter4j-core/src/main/java/twitter4j/http/RequestToken.java
  156. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/async/Dispatcher.java
  157. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherConfiguration.java
  158. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherFactory.java
  159. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/async/DispatcherImpl.java
  160. +17 −25 twitter4j-core/src/main/java/twitter4j/internal/http/BASE64Encoder.java
  161. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/http/HTMLEntity.java
  162. +15 −24 twitter4j-core/src/main/java/twitter4j/internal/http/HttpClient.java
  163. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientConfiguration.java
  164. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientFactory.java
  165. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientImpl.java
  166. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapper.java
  167. +15 −26 twitter4j-core/src/main/java/twitter4j/internal/http/HttpClientWrapperConfiguration.java
  168. +33 −37 twitter4j-core/src/main/java/twitter4j/internal/http/HttpParameter.java
  169. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/http/HttpRequest.java
  170. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponse.java
  171. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseCode.java
  172. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseEvent.java
  173. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/http/HttpResponseImpl.java
  174. +14 −25 twitter4j-core/src/main/java/twitter4j/internal/http/RequestMethod.java
  175. +18 −27 twitter4j-core/src/main/java/twitter4j/internal/http/XAuthAuthorization.java
  176. +24 −30 twitter4j-core/src/main/java/twitter4j/internal/json/DataObjectFactoryUtil.java
  177. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLogger.java
  178. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/logging/CommonsLoggingLoggerFactory.java
  179. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLogger.java
  180. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/logging/Log4JLoggerFactory.java
  181. +24 −38 twitter4j-core/src/main/java/twitter4j/internal/logging/Logger.java
  182. +15 −24 twitter4j-core/src/main/java/twitter4j/internal/logging/LoggerFactory.java
  183. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/logging/NullLogger.java
  184. +15 −25 twitter4j-core/src/main/java/twitter4j/internal/logging/NullLoggerFactory.java
  185. +16 −25 twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLogger.java
  186. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/logging/SLF4JLoggerFactory.java
  187. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/logging/StdOutLoggerFactory.java
  188. +19 −27 twitter4j-core/src/main/java/twitter4j/internal/util/ParseUtil.java
  189. +14 −24 twitter4j-core/src/main/java/twitter4j/internal/util/StringUtil.java
  190. +37 −28 twitter4j-core/src/main/java/twitter4j/json/DataObjectFactory.java
  191. +14 −24 twitter4j-core/src/main/java/twitter4j/json/JSONObjectType.java
  192. +17 −25 twitter4j-core/src/main/java/twitter4j/util/CharacterUtil.java
  193. +14 −24 twitter4j-core/src/main/java/twitter4j/util/TimeSpanConverter.java
  194. +179 −26 twitter4j-core/src/main/resources/META-INF/LICENSE.txt
  195. +15 −25 twitter4j-core/src/test/java/twitter4j/AsyncTwitterTest.java
  196. +14 −24 twitter4j-core/src/test/java/twitter4j/AuthorizationTest.java
  197. +15 −25 twitter4j-core/src/test/java/twitter4j/DAOTest.java
  198. +19 −28 twitter4j-core/src/test/java/twitter4j/PagingTest.java
  199. +14 −24 twitter4j-core/src/test/java/twitter4j/SSLTestUnit.java
  200. +48 −54 twitter4j-core/src/test/java/twitter4j/SearchAPITest.java
  201. +15 −25 twitter4j-core/src/test/java/twitter4j/SiteStreamsTest.java
  202. +15 −24 twitter4j-core/src/test/java/twitter4j/SizeofStatusChecker.java
  203. +17 −28 twitter4j-core/src/test/java/twitter4j/SpringCompatibilityTest.java
  204. +15 −26 twitter4j-core/src/test/java/twitter4j/StreamAPITest.java
  205. +14 −24 twitter4j-core/src/test/java/twitter4j/Twitter4JTestSuite.java
  206. +16 −26 twitter4j-core/src/test/java/twitter4j/TwitterExceptionTest.java
  207. +15 −25 twitter4j-core/src/test/java/twitter4j/TwitterTest.java
  208. +15 −26 twitter4j-core/src/test/java/twitter4j/TwitterTestBase.java
  209. +15 −25 twitter4j-core/src/test/java/twitter4j/UserStreamTest.java
  210. +15 −25 twitter4j-core/src/test/java/twitter4j/conf/ConfigurationTest.java
  211. +14 −24 twitter4j-core/src/test/java/twitter4j/http/BASE64EncoderTest.java
  212. +21 −29 twitter4j-core/src/test/java/twitter4j/http/HTMLEntityTest.java
  213. +14 −24 twitter4j-core/src/test/java/twitter4j/http/HttpClientTest.java
  214. +15 −25 twitter4j-core/src/test/java/twitter4j/http/OAuthTest.java
  215. +39 −47 twitter4j-core/src/test/java/twitter4j/http/PostParameterTest.java
  216. +14 −24 twitter4j-core/src/test/java/twitter4j/internal/async/DispatcherTest.java
  217. +17 −26 twitter4j-core/src/test/java/twitter4j/internal/util/ParseUtilTest.java
  218. +14 −24 twitter4j-core/src/test/java/twitter4j/internal/util/StringUtilTest.java
  219. +14 −24 twitter4j-core/src/test/java/twitter4j/util/CharacterUtilTest.java
  220. +15 −25 twitter4j-core/src/test/java/twitter4j/util/TimeSpanConverterTest.java
  221. +15 −25 twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountSettings.java
  222. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/GetAccountTotals.java
  223. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/GetRateLimitStatus.java
  224. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfile.java
  225. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileBackgroundImage.java
  226. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileColors.java
  227. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/UpdateProfileImage.java
  228. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/account/VerifyCredentials.java
  229. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/async/AsyncUpdate.java
  230. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/block/CreateBlock.java
  231. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/block/DestroyBlock.java
  232. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/block/ExistsBlock.java
  233. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsers.java
  234. +14 −27 twitter4j-examples/src/main/java/twitter4j/examples/block/GetBlockingUsersIDs.java
  235. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/directmessage/DestroyDirectMessage.java
  236. +19 −25 twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetDirectMessages.java
  237. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/directmessage/GetSentDirectMessages.java
  238. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/directmessage/SendDirectMessage.java
  239. +18 −25 twitter4j-examples/src/main/java/twitter4j/examples/directmessage/ShowDirectMessage.java
  240. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/favorite/CreateFavorite.java
  241. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/favorite/DestroyFavorite.java
  242. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/favorite/GetFavorites.java
  243. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFollowersIDs.java
  244. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendsandfollowers/GetFriendsIDs.java
  245. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendship/CreateFriendship.java
  246. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendship/DestroyFriendship.java
  247. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendship/ExistsFriendship.java
  248. +14 −26 twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetIncomingFriendships.java
  249. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendship/GetOutgoingFriendships.java
  250. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendship/LookupFriendships.java
  251. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/friendship/ShowFriendship.java
  252. +15 −25 twitter4j-examples/src/main/java/twitter4j/examples/friendship/UpdateFriendship.java
  253. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/geo/CreatePlace.java
  254. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/geo/GetGeoDetails.java
  255. +15 −26 twitter4j-examples/src/main/java/twitter4j/examples/geo/GetSimilarPlaces.java
  256. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/geo/ReverseGeoCode.java
  257. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/geo/SearchPlaces.java
  258. +15 −25 twitter4j-examples/src/main/java/twitter4j/examples/help/Test.java
  259. +25 −30 twitter4j-examples/src/main/java/twitter4j/examples/json/LoadRawJSON.java
  260. +15 −26 twitter4j-examples/src/main/java/twitter4j/examples/json/SaveRawJSON.java
  261. +15 −25 twitter4j-examples/src/main/java/twitter4j/examples/legal/GetPrivacyPolicy.java
  262. +15 −25 twitter4j-examples/src/main/java/twitter4j/examples/legal/GetTermsOfService.java
  263. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/CreateUserList.java
  264. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/DestroyUserList.java
  265. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/GetAllUserLists.java
  266. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListMemberships.java
  267. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListStatuses.java
  268. +19 −25 twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserListSubscriptions.java
  269. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/GetUserLists.java
  270. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/ShowUserList.java
  271. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/list/UpdateUserList.java
  272. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMember.java
  273. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listmembers/AddUserListMembers.java
  274. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listmembers/CheckUserListMembership.java
  275. +15 −25 twitter4j-examples/src/main/java/twitter4j/examples/listmembers/DeleteUserListMember.java
  276. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listmembers/GetUserListMembers.java
  277. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/CheckUserListSubscription.java
  278. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/GetUserListSubscribers.java
  279. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/SubscribeUserList.java
  280. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/listsubscribers/UnsubscribeUserList.java
  281. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/media/ImgLyImageUpload.java
  282. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/media/PlixiImageUpload.java
  283. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/media/TwippleImageUpload.java
  284. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/media/TwitgooImageUpload.java
  285. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/media/TwitpicImageUpload.java
  286. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/media/YFrogImageUpload.java
  287. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/notification/DisableNotification.java
  288. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/notification/EnableNotification.java
  289. +40 −42 twitter4j-examples/src/main/java/twitter4j/examples/oauth/GetAccessToken.java
  290. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/CreateSavedSearch.java
  291. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/DestroySavedSearch.java
  292. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/GetSavedSearches.java
  293. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/savedsearches/ShowSavedSearch.java
  294. +15 −29 twitter4j-examples/src/main/java/twitter4j/examples/search/SearchTweets.java
  295. +16 −26 twitter4j-examples/src/main/java/twitter4j/examples/spamreporting/ReportSpam.java
  296. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFilterStream.java
  297. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintFirehoseStream.java
  298. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintLinksStream.java
  299. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintRetweetStream.java
  300. +14 −24 twitter4j-examples/src/main/java/twitter4j/examples/stream/PrintSampleStream.java
Sorry, we could not display the entire diff because too many files (356) changed.
View
205 LICENSE.txt
@@ -1,26 +1,179 @@
-Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html
-
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+Twitter4J SUBCOMPONENTS:
+
+Twitter4J includes software from JSON.org to parse JSON response from the Twitter API. You can see the license term at http://www.JSON.org/license.html
View
40 twitter4j-core/src/main/java/twitter4j/AbstractStreamImplementation.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
import twitter4j.conf.Configuration;
View
48 twitter4j-core/src/main/java/twitter4j/AccountSettings.java
@@ -1,59 +1,57 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
* @since Twitter4J 2.1.9
*/
-public interface AccountSettings extends TwitterResponse, java.io.Serializable {
+public interface AccountSettings extends TwitterResponse, java.io.Serializable {
/**
* Returns true if the user enabled sleep time.
+ *
* @return true if the user enabled sleep time
*/
boolean isSleepTimeEnabled();
/**
* Returns sleep start time.
+ *
* @return sleep start time
*/
String getSleepStartTime();
+
/**
* Returns sleep end time.
+ *
* @return sleep end time
*/
String getSleepEndTime();
+
/**
* Return the user's trend locations
+ *
* @return the user's trend locations
*/
Location[] getTrendLocations();
+
/**
* Return true if the user is enabling geo location
+ *
* @return true if the user is enabling geo location
*/
boolean isGeoEnabled();
View
40 twitter4j-core/src/main/java/twitter4j/AccountSettingsJSONImpl.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
import twitter4j.internal.http.HttpResponse;
@@ -58,7 +48,7 @@ private AccountSettingsJSONImpl(HttpResponse res, JSONObject json) throws Twitte
} else {
JSONArray locations = json.getJSONArray("trend_location");
TREND_LOCATION = new Location[locations.length()];
- for(int i=0;i<locations.length();i++){
+ for (int i = 0; i < locations.length(); i++) {
TREND_LOCATION[i] = new LocationJSONImpl(locations.getJSONObject(i));
}
}
View
40 twitter4j-core/src/main/java/twitter4j/AccountTotals.java
@@ -1,33 +1,21 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
-import twitter4j.internal.logging.Logger;
-
/**
* @author Yusuke Yamamoto - yusuke at mac.com
* @since Twitter4J 2.1.9
View
41 twitter4j-core/src/main/java/twitter4j/AccountTotalsJSONImpl.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
import twitter4j.internal.http.HttpResponse;
@@ -43,6 +33,7 @@
private final int followers;
private final int favorites;
private final int friends;
+
private AccountTotalsJSONImpl(HttpResponse res, JSONObject json) {
super(res);
updates = getInt("updates", json);
View
389 twitter4j-core/src/main/java/twitter4j/Annotation.java
@@ -1,265 +1,266 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
+import twitter4j.internal.org.json.JSONException;
+import twitter4j.internal.org.json.JSONObject;
+
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
-import twitter4j.internal.org.json.JSONException;
-import twitter4j.internal.org.json.JSONObject;
-
/**
* A data class representing an Annotation of a Status or a Tweet
*
* @author Roy Reshef - royreshef at gmail.com
- * @since Twitter4J 2.1.4
* @see <a href="http://dev.twitter.com/pages/annotations_overview">Annotations Overview | dev.twitter.com</a>
+ * @since Twitter4J 2.1.4
*/
public class Annotation implements Comparable<Annotation>, java.io.Serializable {
- private static final long serialVersionUID = -6515375141284988754L;
- private String type = null;
- private Map<String, String> attributes = null;
-
- /**
- * Construct an Annotation with a type but no attributes
- * @param type - the type
- */
- public Annotation(String type) {
- setType(type);
- setAttributes(null);
- }
-
- /**
- * Construct an Annotation with a type and attributes
- * @param type
- * @param attributes
- */
- public Annotation(String type, Map<String, String> attributes) {
- setType(type);
- setAttributes(attributes);
- }
-
- /**
+ private static final long serialVersionUID = -6515375141284988754L;
+ private String type = null;
+ private Map<String, String> attributes = null;
+
+ /**
+ * Construct an Annotation with a type but no attributes
+ *
+ * @param type - the type
+ */
+ public Annotation(String type) {
+ setType(type);
+ setAttributes(null);
+ }
+
+ /**
+ * Construct an Annotation with a type and attributes
+ *
+ * @param type
+ * @param attributes
+ */
+ public Annotation(String type, Map<String, String> attributes) {
+ setType(type);
+ setAttributes(attributes);
+ }
+
+ /**
* Construct an Annotation instance from a JSON Object, returned from Twitter API
* Package visibility only!
- * @param jsonObject - the JSON Object
- */
- Annotation(JSONObject jsonObject) {
- String typ = null;
- Map<String, String> attrs = null;
- Iterator it = jsonObject.keys();
- if (it.hasNext()) {
- typ = (String)it.next();
- // we expect only one key - the type; if there are more it's a malformed JSON object
- if (it.hasNext()) {
- type = null;
- } else {
- try {
- JSONObject jo = jsonObject.getJSONObject(typ);
- attrs = new LinkedHashMap<String, String>();
- it = jo.keys();
- while (it.hasNext()) {
- String key = (String)it.next();
- String value = jo.getString(key);
- attrs.put(key, value);
- }
- } catch (JSONException jsone) {
- // clear all
- typ = null;
- attrs = null;
- }
- }
- }
- setType(typ);
- setAttributes(attrs);
- }
+ *
+ * @param jsonObject - the JSON Object
+ */
+ Annotation(JSONObject jsonObject) {
+ String typ = null;
+ Map<String, String> attrs = null;
+ Iterator it = jsonObject.keys();
+ if (it.hasNext()) {
+ typ = (String) it.next();
+ // we expect only one key - the type; if there are more it's a malformed JSON object
+ if (it.hasNext()) {
+ type = null;
+ } else {
+ try {
+ JSONObject jo = jsonObject.getJSONObject(typ);
+ attrs = new LinkedHashMap<String, String>();
+ it = jo.keys();
+ while (it.hasNext()) {
+ String key = (String) it.next();
+ String value = jo.getString(key);
+ attrs.put(key, value);
+ }
+ } catch (JSONException jsone) {
+ // clear all
+ typ = null;
+ attrs = null;
+ }
+ }
+ }
+ setType(typ);
+ setAttributes(attrs);
+ }
/**
* @return the type
*/
public String getType() {
- return type;
+ return type;
}
-
+
/**
* Sets the type
* Ensures the class's property is not null
+ *
* @param type - the type
*/
public void setType(String type) {
- this.type = (type == null) ? "" : type;
+ this.type = (type == null) ? "" : type;
}
-
+
/**
* Sets the type
* Ensures the class's property is not null
+ *
* @param type - the type
* @return this (for coding convenience)
*/
public Annotation type(String type) {
- setType(type);
- return this;
+ setType(type);
+ return this;
}
/**
* @return the attributes
*/
public Map<String, String> getAttributes() {
- return attributes;
+ return attributes;
}
-
+
/**
* Sets the attributes
* Ensures the class's property is not null
+ *
* @param attributes - the attributes
*/
public void setAttributes(Map<String, String> attributes) {
- this.attributes = (attributes == null) ?
- new LinkedHashMap<String, String>() : attributes;
- }
+ this.attributes = (attributes == null) ?
+ new LinkedHashMap<String, String>() : attributes;
+ }
/**
* Sets the attributes
* Ensures the class's property is not null
+ *
* @param attributes - the attributes
* @return this (for coding convenience)
*/
public Annotation attributes(Map<String, String> attributes) {
- setAttributes(attributes);
- return this;
- }
-
+ setAttributes(attributes);
+ return this;
+ }
+
/**
* Adds a single attribute
- * @param name - the attribute name
+ *
+ * @param name - the attribute name
* @param value - the attribute value
*/
public void addAttribute(String name, String value) {
- this.attributes.put(name, value);
+ this.attributes.put(name, value);
}
-
+
/**
* Adds a single attribute
- * @param name - the attribute name
+ *
+ * @param name - the attribute name
* @param value - the attribute value
* @return this (for coding convenience)
*/
public Annotation attribute(String name, String value) {
- addAttribute(name, value);
- return this;
+ addAttribute(name, value);
+ return this;
+ }
+
+ /**
+ * @return true if the attributes are empty, false otherwise
+ */
+ public boolean isEmpty() {
+ return attributes.isEmpty();
}
-
- /**
- * @return true if the attributes are empty, false otherwise
- */
- public boolean isEmpty() {
- return attributes.isEmpty();
- }
- /**
- * @return true the number of attributes
- */
+ /**
+ * @return true the number of attributes
+ */
public Integer size() {
- return attributes.size();
+ return attributes.size();
}
-
- /**
- * Package visibility only!
- * @return the JSON String representation of this
- */
- String asParameterValue() {
- return asJSONObject().toString();
+
+ /**
+ * Package visibility only!
+ *
+ * @return the JSON String representation of this
+ */
+ String asParameterValue() {
+ return asJSONObject().toString();
}
-
- /**
- * Package visibility only!
- * Converts this to a JSON object according to Twitter's specification
- * @return the JSON Object
- */
- JSONObject asJSONObject() {
- JSONObject jsonObject = new JSONObject();
- try {
- jsonObject.put(type, attributes);
- } catch (JSONException ignore) {
- }
- return jsonObject;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
- public int compareTo(Annotation other) {
- // Precedence of order:
- // 1. Type
- // 2. Number of attributes
- // 3. Sorted attributes - For each attribute: name, then value
+
+ /**
+ * Package visibility only!
+ * Converts this to a JSON object according to Twitter's specification
+ *
+ * @return the JSON Object
+ */
+ JSONObject asJSONObject() {
+ JSONObject jsonObject = new JSONObject();
+ try {
+ jsonObject.put(type, attributes);
+ } catch (JSONException ignore) {
+ }
+ return jsonObject;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Comparable#compareTo(java.lang.Object)
+ */
+ public int compareTo(Annotation other) {
+ // Precedence of order:
+ // 1. Type
+ // 2. Number of attributes
+ // 3. Sorted attributes - For each attribute: name, then value
if (null == other) {
return 1;
}
if (this == other) {
return 0;
}
- int result = this.getType().compareTo(other.getType());
- if (result != 0) {
- return result;
- }
- result = this.size().compareTo(other.size());
- if (result != 0) {
- return result;
- }
-
- Iterator<String> thisNamesIt = this.sortedNames().iterator();
- Iterator<String> otherNamesIt = other.sortedNames().iterator();
-
- while (thisNamesIt.hasNext()) {
- String thisName = thisNamesIt.next();
- String otherName = otherNamesIt.next();
- result = thisName.compareTo(otherName);
- if (result != 0) {
- return result;
- }
- String thisValue = this.getAttributes().get(thisName);
- String otherValue = other.getAttributes().get(otherName);
- result = thisValue.compareTo(otherValue);
- if (result != 0) {
- return result;
- }
- }
- return 0;
- }
+ int result = this.getType().compareTo(other.getType());
+ if (result != 0) {
+ return result;
+ }
+ result = this.size().compareTo(other.size());
+ if (result != 0) {
+ return result;
+ }
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
+ Iterator<String> thisNamesIt = this.sortedNames().iterator();
+ Iterator<String> otherNamesIt = other.sortedNames().iterator();
+
+ while (thisNamesIt.hasNext()) {
+ String thisName = thisNamesIt.next();
+ String otherName = otherNamesIt.next();
+ result = thisName.compareTo(otherName);
+ if (result != 0) {
+ return result;
+ }
+ String thisValue = this.getAttributes().get(thisName);
+ String otherValue = other.getAttributes().get(otherName);
+ result = thisValue.compareTo(otherValue);
+ if (result != 0) {
+ return result;
+ }
+ }
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
if (null == obj) {
return false;
}
@@ -267,37 +268,37 @@ public boolean equals(Object obj) {
return true;
}
if (!(obj instanceof Annotation)) {
- return false;
+ return false;
}
Annotation other = (Annotation) obj;
// Map comparison ignores the order of the map entries -
// which is exactly what we want here for the attributes
- return ((this.getType().equals(other.getType())) &&
- (this.getAttributes().equals(other.getAttributes())));
- }
+ return ((this.getType().equals(other.getType())) &&
+ (this.getAttributes().equals(other.getAttributes())));
+ }
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
- return ((31 * type.hashCode()) + attributes.hashCode());
+ return ((31 * type.hashCode()) + attributes.hashCode());
}
-
+
@Override
public String toString() {
StringBuffer sb = new StringBuffer("Annotation{type='");
sb.append(type).append("', attributes={");
Iterator<String> nameIt = attributes.keySet().iterator();
while (nameIt.hasNext()) {
- String name = nameIt.next();
- String value = attributes.get(name);
- sb.append('\'').append(name).append("'='").append(value).append('\'');
- if (nameIt.hasNext()) {
- sb.append(", ");
- }
+ String name = nameIt.next();
+ String value = attributes.get(name);
+ sb.append('\'').append(name).append("'='").append(value).append('\'');
+ if (nameIt.hasNext()) {
+ sb.append(", ");
+ }
}
- sb.append("}}");
+ sb.append("}}");
return sb.toString();
}
@@ -305,9 +306,9 @@ public String toString() {
* @return a sorted set of the attributes' names
*/
private SortedSet<String> sortedNames() {
- SortedSet<String> names = new TreeSet<String>();
- names.addAll(getAttributes().keySet());
- return names;
+ SortedSet<String> names = new TreeSet<String>();
+ names.addAll(getAttributes().keySet());
+ return names;
}
}
View
246 twitter4j-core/src/main/java/twitter4j/Annotations.java
@@ -1,164 +1,160 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
+import twitter4j.internal.org.json.JSONArray;
+import twitter4j.internal.org.json.JSONException;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import twitter4j.internal.org.json.JSONArray;
-import twitter4j.internal.org.json.JSONException;
-
/**
* A data class representing the Annotations of a Status or a Tweet
*
* @author Roy Reshef - royreshef at gmail.com
- * @since Twitter4J 2.1.4
* @see <a href="http://dev.twitter.com/pages/annotations_overview">Annotations Overview | dev.twitter.com</a>
+ * @since Twitter4J 2.1.4
*/
public class Annotations implements java.io.Serializable {
- private static final long serialVersionUID = 7928827620306593741L;
- public static final int lengthLimit = 512;
- private List<Annotation> annotations = null;
+ private static final long serialVersionUID = 7928827620306593741L;
+ public static final int lengthLimit = 512;
+ private List<Annotation> annotations = null;
/**
* Construct empty Annotations instance
*/
public Annotations() {
- setAnnotations(null);
+ setAnnotations(null);
}
-
+
/**
* Construct Annotations instance from an exisiting List of Annotation instances
+ *
* @param annotations - the List of Annotation instances
*/
public Annotations(List<Annotation> annotations) {
- setAnnotations(annotations);
+ setAnnotations(annotations);
}
-
+
/**
* Construct Annotations instance from a JSON Array, returned from Twitter API
* Package visibility only!
+ *
* @param jsonArray - the JSON Array
*/
Annotations(JSONArray jsonArray) {
- setAnnotations(null);
- try {
- for (int i = 0; i < jsonArray.length(); i++) {
- addAnnotation(new Annotation(jsonArray.getJSONObject(i)));
- }
- } catch (JSONException jsone) {
- // malformed JSONObject - just empty the list of Annotations
- annotations.clear();
- }
- }
-
+ setAnnotations(null);
+ try {
+ for (int i = 0; i < jsonArray.length(); i++) {
+ addAnnotation(new Annotation(jsonArray.getJSONObject(i)));
+ }
+ } catch (JSONException jsone) {
+ // malformed JSONObject - just empty the list of Annotations
+ annotations.clear();
+ }
+ }
+
/**
* @return the List of Annotation instances
*/
public List<Annotation> getAnnotations() {
- return annotations;
+ return annotations;
}
/**
* Sets the List of Annotation instances
* Ensures the class's property is not null
+ *
* @param annotations - the List of Annotation instances
*/
public void setAnnotations(List<Annotation> annotations) {
- this.annotations =
- (annotations == null) ? new ArrayList<Annotation>() : annotations;
- }
-
- /**
- * Adds a single Annotation to the List of Annotation instances
- * @param annotation - the Annotation to add
- */
- public void addAnnotation(Annotation annotation) {
- this.annotations.add(annotation);
- }
+ this.annotations =
+ (annotations == null) ? new ArrayList<Annotation>() : annotations;
+ }
/**
- * Adds a single Annotation to the List of Annotation instances
- * @param annotation - the Annotation to add
+ * Adds a single Annotation to the List of Annotation instances
+ *
+ * @param annotation - the Annotation to add
+ */
+ public void addAnnotation(Annotation annotation) {
+ this.annotations.add(annotation);
+ }
+
+ /**
+ * Adds a single Annotation to the List of Annotation instances
+ *
+ * @param annotation - the Annotation to add
* @return this (for coding convenience)
*/
public Annotations annotation(Annotation annotation) {
- addAnnotation(annotation);
- return this;
+ addAnnotation(annotation);
+ return this;
+ }
+
+ /**
+ * @return true if the List of Annotation instances is empty, false otherwise
+ */
+ public boolean isEmpty() {
+ return annotations.isEmpty();
}
-
- /**
- * @return true if the List of Annotation instances is empty, false otherwise
- */
- public boolean isEmpty() {
- return annotations.isEmpty();
- }
/**
- * @return the number of Annotation instances in the List
+ * @return the number of Annotation instances in the List
*/
public Integer size() {
- return annotations.size();
- }
-
- /**
- * @param annotations - the instance to test
- * @return true if the JSON String representation of the instance exceeds the limit imposed by Twitter, false otherwise
- */
- public static boolean isExceedingLengthLimit(Annotations annotations) {
- return (annotations.asParameterValue().length() > lengthLimit);
- }
-
- /**
- * @return true if the JSON String representation of this exceeds the limit imposed by Twitter, false otherwise
- */
- public boolean isExceedingLengthLimit() {
- return isExceedingLengthLimit(this);
- }
-
- /**
- * Package visibility only!
- * @return the JSON String representation of this
- */
- String asParameterValue() {
- JSONArray jsonArray = new JSONArray();
- for (Annotation annotation : annotations) {
- jsonArray.put(annotation.asJSONObject());
- }
- return jsonArray.toString();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
+ return annotations.size();
+ }
+
+ /**
+ * @param annotations - the instance to test
+ * @return true if the JSON String representation of the instance exceeds the limit imposed by Twitter, false otherwise
+ */
+ public static boolean isExceedingLengthLimit(Annotations annotations) {
+ return (annotations.asParameterValue().length() > lengthLimit);
+ }
+
+ /**
+ * @return true if the JSON String representation of this exceeds the limit imposed by Twitter, false otherwise
+ */
+ public boolean isExceedingLengthLimit() {
+ return isExceedingLengthLimit(this);
+ }
+
+ /**
+ * Package visibility only!
+ *
+ * @return the JSON String representation of this
+ */
+ String asParameterValue() {
+ JSONArray jsonArray = new JSONArray();
+ for (Annotation annotation : annotations) {
+ jsonArray.put(annotation.asJSONObject());
+ }
+ return jsonArray.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
if (null == obj) {
return false;
}
@@ -167,44 +163,44 @@ public boolean equals(Object obj) {
}
// shouldn't use the List directly as the Annotations are equal
// regardless of the order of the Annotation instances
- return ((obj instanceof Annotations) &&
- ((Annotations) obj).getSortedAnnotations().equals(this.getSortedAnnotations()));
- }
+ return ((obj instanceof Annotations) &&
+ ((Annotations) obj).getSortedAnnotations().equals(this.getSortedAnnotations()));
+ }
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
- return getSortedAnnotations().hashCode();
+ return getSortedAnnotations().hashCode();
}
-
+
/* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
+ * @see java.lang.Object#toString()
+ */
@Override
public String toString() {
StringBuffer sb = new StringBuffer("Annotations{");
- for (int i = 0; i < size() ; i++) {
- if (i > 0) {
- sb.append(", ");
- }
- sb.append(annotations.get(i).toString());
+ for (int i = 0; i < size(); i++) {
+ if (i > 0) {
+ sb.append(", ");
+ }
+ sb.append(annotations.get(i).toString());
}
sb.append('}');
-
+
return sb.toString();
}
-
+
/**
* @return a sorted copy of the List of Annotation instances
*/
private List<Annotation> getSortedAnnotations() {
- // create a new list - we do not want to change the order in the original one
- List<Annotation> sortedAnnotations = new ArrayList<Annotation>(size());
- sortedAnnotations.addAll(this.annotations);
- Collections.sort(sortedAnnotations);
- return sortedAnnotations;
+ // create a new list - we do not want to change the order in the original one
+ List<Annotation> sortedAnnotations = new ArrayList<Annotation>(size());
+ sortedAnnotations.addAll(this.annotations);
+ Collections.sort(sortedAnnotations);
+ return sortedAnnotations;
}
}
View
40 twitter4j-core/src/main/java/twitter4j/AsyncTwitter.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
import twitter4j.api.*;
View
38 twitter4j-core/src/main/java/twitter4j/AsyncTwitterFactory.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
import twitter4j.conf.Configuration;
View
40 twitter4j-core/src/main/java/twitter4j/Category.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
/**
@@ -32,6 +22,8 @@
*/
public interface Category {
String getName();
+
String getSlug();
+
int getSize();
}
View
41 twitter4j-core/src/main/java/twitter4j/CategoryJSONImpl.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
import twitter4j.internal.http.HttpResponse;
@@ -85,7 +75,6 @@ public String getSlug() {
}
/**
- *
* @return
* @since Twitter4J 2.1.9
*/
View
38 twitter4j-core/src/main/java/twitter4j/ConnectionLifeCycleListener.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
/**
View
43 twitter4j-core/src/main/java/twitter4j/CursorSupport.java
@@ -1,56 +1,41 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
package twitter4j;
/**
- *
* @author Yusuke Yamamoto - yusuke at mac.com
*/
public interface CursorSupport {
/**
- *
* @since Twitter4J 2.0.10
*/
boolean hasPrevious();
/**
- *
* @since Twitter4J 2.0.10
*/
long getPreviousCursor();
/**
- *
* @since Twitter4J 2.0.10
*/
boolean hasNext();
/**
- *
* @since Twitter4J 2.0.10
*/
long getNextCursor();
View
42 twitter4j-core/src/main/java/twitter4j/DirectMessage.java
@@ -1,34 +1,26 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
import java.util.Date;
+
/**
* A data interface representing sent/received direct message.
+ *
* @author Yusuke Yamamoto - yusuke at mac.com
*/
public interface DirectMessage extends TwitterResponse, java.io.Serializable {
View
57 twitter4j-core/src/main/java/twitter4j/DirectMessageJSONImpl.java
@@ -1,29 +1,19 @@
/*
-Copyright (c) 2007-2011, Yusuke Yamamoto
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Yusuke Yamamoto nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright 2007 Yusuke Yamamoto
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package twitter4j;
import twitter4j.internal.http.HttpResponse;
@@ -33,9 +23,15 @@
import twitter4j.internal.org.json.JSONObject;
import java.util.Date;
-import static twitter4j.internal.util.ParseUtil.*;
+
+import static twitter4j.internal.util.ParseUtil.getDate;
+import static twitter4j.internal.util.ParseUtil.getInt;
+import static twitter4j.internal.util.ParseUtil.getLong;
+import static twitter4j.internal.util.ParseUtil.getUnescapedString;
+
/**
* A data class representing sent/received direct message.
+ *
* @author Yusuke Yamamoto - yusuke at mac.com
*/
/*package*/ final class DirectMessageJSONImpl extends TwitterResponseImpl implements DirectMessage, java.io.Serializable {
@@ -56,10 +52,12 @@
DataObjectFactoryUtil.clearThreadLocalMap();
DataObjectFactoryUtil.registerJSONObject(this, json);
}
+
/*package*/DirectMessageJSONImpl(JSONObject json) throws TwitterException {
init(json);
}
- private void init(JSONObject json) throws TwitterException{
+
+ private void init(JSONObject json) throws TwitterException {
id = getLong("id", json);
text = getUnescapedString("