View Javadoc

1   package com.atlassian.httpclient.api;
2   
3   import com.atlassian.util.concurrent.Promise;
4   import com.google.common.base.Function;
5   
6   /**
7    * A specific type of Promise for transforming a promise with a response into another object
8    * with functions for different HTTP codes and situations
9    */
10  public interface ResponsePromise extends Promise<Response> {
11      /**
12       * Helps transforming this response promise into a new promise using {@link Function} to transform response into a
13       * new {@code T}.
14       *
15       * @param <T> the type of the expected object once transformed.
16       * @return a {@link com.atlassian.util.concurrent.Promise<T>}
17       */
18      public <T> Promise<T> transform(ResponseTransformation<T> transformation);
19  }