Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src Replace @ParametersAreNonnullByDefault with @EverythingIsNonNull Oct 6, 2018
README.md Update README.md Jul 4, 2018
pom.xml Next version is 2.6.0 Apr 3, 2019

README.md

Guava Adapter

An Adapter for adapting Guava ListenableFuture.

Usage

Add GuavaCallAdapterFactory as a Call adapter when building your Retrofit instance:

Retrofit retrofit = new Retrofit.Builder()
    .baseUrl("https://example.com/")
    .addCallAdapterFactory(GuavaCallAdapterFactory.create())
    .build();

Your service methods can now use ListenableFuture as their return type.

interface MyService {
  @GET("/user")
  ListenableFuture<User> getUser();
}

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.squareup.retrofit2</groupId>
  <artifactId>adapter-guava</artifactId>
  <version>latest.version</version>
</dependency>

or Gradle:

implementation 'com.squareup.retrofit2:adapter-guava:latest.version'

Snapshots of the development version are available in Sonatype's snapshots repository.

You can’t perform that action at this time.