Java Wrapper for Trello API
This project is a Java Wrapper for the Trello API. It provides a fluent interface for requesting the API
trello-java-wrapper is available on maven central. The current release is 0.3.2
<dependency>
<groupId>com.julienvey.trello</groupId>
<artifactId>trello-java-wrapper</artifactId>
<version>0.3.2</version>
</dependency>
The wrapper can make use of one of the following HTTP clients: Spring Web
(default), Apache Http Components HttpClient
, Ning async-http-client
. Choose one if you dont' already use one of those. If you use or choose anything but Spring Web, you'll need to instantiate the corresponding TrelloHttpClient
implementation and pass it to the TrelloImpl
constructor (see Init section below). The corresponding Maven coordinates are:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
</dependency>
Failure to do so will most probably cause a NoClassDefFoundError
.
To be able to use the wrapper, you simply need to instantiate the interface Trello
and provide it with two parameters
- trelloKey : The key of your application
- trelloAccessToken : the oauth token of the authenticated user on Trello
Trello trelloApi = new TrelloImpl(trelloKey, trelloAccessToken);
Then, simply use the object you just created to access the API
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();
trello-java-wrapper is still a work in progress and has not yet reached version 1.0. It is licensed under the Apache v2 License.
If you are missing some fonctionnalities, you can easily contribute and propose a pull request. Each pull request should respect current code conventions and also provide tests for the newly implemented features.