#Twitter4J 4.0.4 released – supports longer DM texts, lambda expression and more

We have just release Twitter4J 4.0.4. The build is available at the Maven central repository and Twitter4J.org’s snapshot repository.

Migration

We have made some slight changes that could introduce binary compatibility, and it is encouraged to REBUILD your project when migrating to version 4.0.4.

Support for longer DM texts

Twitter will be allowing users to send and receive 140+ DMs in July. Projects using Twitter4J 4.0.4+ will receive longer DM text without any code change.
twitter community.com: Removing the 140 character limit from Direct Messages

Support for lambda expression

Twitter4J is finally lambda ready. You can implement streaming API’s listener actions in lambda expression using onStatus(Consumer) and onException(Consumer).
This is done by introducing Twitter4J specific functional interface, and Twitter4J will be continued to be compatible with Java 6+.

Support for variable arguments in many places

Twitter4J now accepts variable arguments in many places. It is no longer required to put new String[]{} when passing list of screen names, filtering terms.

Please take a few seconds to see how lambda and varargs will simplify Twitter4J’s client code:
twitter4j/examples/lambda/TwitterStreamLambda.java

SavedSearch id type migration

int is no more sufficient to handle SavedSearch’s id. The return type of SavedSearch#getId() is now long. Note that serialized objects of this class is not compatible with previous releases.

Comments are closed.