Java Wrapper for Trello API
This project is a Java Wrapper for the Trello REST API. It provides a fluent interface for requesting the API.
Available in Maven Central. Gradle dependency declaration:
dependencies {
compile 'com.taskadapter:trello-java-wrapper:<current-version>'
}
The wrapper can make use of one of the following HTTP clients:
Spring Web- Dependency included by default
- Apache Http Components HttpClient
- Gradle dependency:
compile 'org.apache.httpcomponents:httpclient:VERSION'
- Gradle dependency:
- Async Http Client
compile 'org.asynchttpclient:async-http-client:VERSION
- Ning async-http-client
- The predecessor to the modern Async Http Client above
compile 'com.ning:async-http-client:VERSION
Choose one if you don't already use one of those.
You will need to instantiate the corresponding TrelloHttpClient implementation and pass it to the TrelloImpl
constructor (see Init section below).
Optional dependency in case you want to attach files to cards:
compile 'org.apache.httpcomponents:httpmime'
Failure to do so will most probably cause a NoClassDefFoundError.
First, create an instance of TrelloImpl. This examples uses an http client based on Apache Http library.
Trello trelloApi = new TrelloImpl(trelloKey, trelloAccessToken, new ApacheHttpClient());- trelloKey : The key of your application
- trelloAccessToken : the oauth token of the authenticated user on Trello
- http client : one of supported http client implementations. See
com.julienvey.trello.impl.httppackage.
Sample call:
Board board = trelloApi.getBoard(trelloBoardForAddingCardsId);The wrapper provides a fluent interface. On each "Trello" Object, you have access to methods to fetch other object
Board board = trelloApi.getBoard(trelloBoardForAddingCardsId);
List<TList> lists = board.fetchLists();which can also be written like this
List<TList> lists = trelloApi.getBoard(trelloBoardForAddingCardsId).fetchLists();Each pull request should respect current code conventions and provide tests for the newly implemented features. The new test code is implemented using Scala. The prod code is only Java - to avoid adding extra Scala dependency to the lib without providing much value (at the moment).