Class AuthorizationRedirectResponse<T>
- java.lang.Object
-
- de.sonallux.spotify.api.authorization.AuthorizationRedirectResponse<T>
-
public class AuthorizationRedirectResponse<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description AuthorizationRedirectResponse()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> AuthorizationRedirectResponse<T>error(String error)static <T> AuthorizationRedirectResponse<T>error(String error, String state)booleanisSuccess()static <T> AuthorizationRedirectResponse<T>parse(String url, Function<okhttp3.HttpUrl,T> contentExtractor)Parses the authorization response from the callback urlstatic <T> AuthorizationRedirectResponse<T>parse(okhttp3.HttpUrl httpUrl, Function<okhttp3.HttpUrl,T> contentExtractor)Parses the authorization response from the callback urlstatic <T> AuthorizationRedirectResponse<T>success(T body)static <T> AuthorizationRedirectResponse<T>success(T body, String state)
-
-
-
Method Detail
-
isSuccess
public boolean isSuccess()
-
success
public static <T> AuthorizationRedirectResponse<T> success(T body, String state)
-
success
public static <T> AuthorizationRedirectResponse<T> success(T body)
-
error
public static <T> AuthorizationRedirectResponse<T> error(String error, String state)
-
error
public static <T> AuthorizationRedirectResponse<T> error(String error)
-
parse
public static <T> AuthorizationRedirectResponse<T> parse(String url, Function<okhttp3.HttpUrl,T> contentExtractor)
Parses the authorization response from the callback url- Parameters:
url- the callback url- Returns:
- the authorization response
- Throws:
IllegalArgumentException- Ifuriis not a well-formed URI.
-
parse
public static <T> AuthorizationRedirectResponse<T> parse(okhttp3.HttpUrl httpUrl, Function<okhttp3.HttpUrl,T> contentExtractor)
Parses the authorization response from the callback url- Parameters:
httpUrl- the callback url- Returns:
- the authorization response
- Throws:
IllegalArgumentException- Ifuriis not a well-formed URI.
-
-