Uses of Class
com.github.badpop.jcoinbase.control.CallResult
-
Uses of CallResult in com.github.badpop.jcoinbase.control
Subclasses of CallResult in com.github.badpop.jcoinbase.control Modifier and Type Class Description static class
CallResult.Failure<L,R>
TheFailure
version of aCallResult
.static class
CallResult.Success<L,R>
TheSuccess
version of aCallResult
.Methods in com.github.badpop.jcoinbase.control that return CallResult Modifier and Type Method Description <X, Y> CallResult<X,Y>
CallResult. bimap(java.util.function.Function<? super L,? extends X> failureMapper, java.util.function.Function<? super R,? extends Y> successMapper)
Maps callResult the failure or the success side of this disjunction.static <L, R> CallResult<L,R>
CallResult. failure(L failure)
Constructs aCallResult.Failure
CallResult<L,R>
CallResult. filterOrElse(java.util.function.Predicate<? super R> predicate, java.util.function.Function<? super R,? extends L> zero)
Filters this success-biasedCallResult
by testing a predicate.<U> CallResult<L,U>
CallResult. flatMap(java.util.function.Function<? super R,? extends CallResult<L,? extends U>> mapper)
FlatMaps this success-biased CallResult.<U> CallResult<L,U>
CallResult. map(java.util.function.Function<? super R,? extends U> mapper)
Maps the value of this CallResult if it is a Success, performs no operation if this is a Failure.<U> CallResult<U,R>
CallResult. mapFailure(java.util.function.Function<? super L,? extends U> failureMapper)
Maps the value of this CallResult if it is a Failure, performs no operation if this is a Success.<U> CallResult<U,R>
CallResult. mapLeft(java.util.function.Function<? super L,? extends U> leftMapper)
Maps the value of this CallResult if it is a Failure, performs no operation if this is a Success.static <L, R> CallResult<L,R>
CallResult. narrow(CallResult<? extends L,? extends R> callResult)
Narrows a widenedCallResult<? extends L, ? extends R>
toCallResult<L, R>
by performing a type-safe cast.CallResult<L,R>
CallResult. orElse(CallResult<? extends L,? extends R> other)
CallResult<L,R>
CallResult. orElse(java.util.function.Supplier<? extends CallResult<? extends L,? extends R>> supplier)
CallResult<L,R>
CallResult. peek(java.util.function.Consumer<? super L> failureAction, java.util.function.Consumer<? super R> successAction)
Performs the givenfailureAction
on the failure element if this is Failure.CallResult<L,R>
CallResult. peek(java.util.function.Consumer<? super R> action)
CallResult<L,R>
CallResult. peekFailure(java.util.function.Consumer<? super L> action)
CallResult<L,R>
CallResult. recover(java.util.function.Function<? super L,? extends R> recoveryFunction)
CallsrecoveryFunction
if the projected CallResult is a Failure, or returnsthis
if Success.CallResult<L,R>
CallResult. recoverWith(java.util.function.Function<? super L,? extends CallResult<? extends L,? extends R>> recoveryFunction)
Calls recoveryFunction if the projected CallResult is a Failure, performs no operation if this is a Success.static <L, R> CallResult<io.vavr.collection.Seq<L>,io.vavr.collection.Seq<R>>
CallResult. sequence(java.lang.Iterable<? extends CallResult<? extends L,? extends R>> callResults)
Reduces manyCallResult
s into a singleCallResult
by transforming anIterable<CallResult<L, R>>
into aCallResult<Seq<L>, Seq<R>>
.static <L, R> CallResult<L,R>
CallResult. success(R success)
Constructs aCallResult.Success
CallResult<R,L>
CallResult. swap()
Converts aFailure
to aSuccess
vice versa by wrapping the value in a new type.CallResult<L,R>
CallResult.FailureProjection. toCallResult()
Returns the underlying callResult of this projection.CallResult<L,R>
CallResult.SuccessProjection. toCallResult()
Returns the underlying callResult of this projection.default <L> CallResult<L,T>
FunctionalValue. toCallResult(java.util.function.Supplier<? extends L> leftSupplier)
Converts this to aCallResult
.default <L> CallResult<L,T>
FunctionalValue. toCallResult(L left)
Converts this to aCallResult
.Methods in com.github.badpop.jcoinbase.control that return types with arguments of type CallResult Modifier and Type Method Description io.vavr.control.Option<CallResult<L,R>>
CallResult. filter(java.util.function.Predicate<? super R> predicate)
Filters this success-biasedCallResult
by testing a predicate.io.vavr.control.Option<CallResult<L,R>>
CallResult. filterNot(java.util.function.Predicate<? super R> predicate)
Filters this success-biasedCallResult
by testing a predicate.Methods in com.github.badpop.jcoinbase.control with parameters of type CallResult Modifier and Type Method Description static <L, R> CallResult<L,R>
CallResult. narrow(CallResult<? extends L,? extends R> callResult)
Narrows a widenedCallResult<? extends L, ? extends R>
toCallResult<L, R>
by performing a type-safe cast.CallResult<L,R>
CallResult. orElse(CallResult<? extends L,? extends R> other)
Method parameters in com.github.badpop.jcoinbase.control with type arguments of type CallResult Modifier and Type Method Description <U> CallResult<L,U>
CallResult. flatMap(java.util.function.Function<? super R,? extends CallResult<L,? extends U>> mapper)
FlatMaps this success-biased CallResult.CallResult<L,R>
CallResult. orElse(java.util.function.Supplier<? extends CallResult<? extends L,? extends R>> supplier)
CallResult<L,R>
CallResult. recoverWith(java.util.function.Function<? super L,? extends CallResult<? extends L,? extends R>> recoveryFunction)
Calls recoveryFunction if the projected CallResult is a Failure, performs no operation if this is a Success.static <L, R> CallResult<io.vavr.collection.Seq<L>,io.vavr.collection.Seq<R>>
CallResult. sequence(java.lang.Iterable<? extends CallResult<? extends L,? extends R>> callResults)
Reduces manyCallResult
s into a singleCallResult
by transforming anIterable<CallResult<L, R>>
into aCallResult<Seq<L>, Seq<R>>
.<U> U
CallResult. transform(java.util.function.Function<? super CallResult<L,R>,? extends U> f)
Transforms thisCallResult
. -
Uses of CallResult in com.github.badpop.jcoinbase.service.account
Methods in com.github.badpop.jcoinbase.service.account that return CallResult Modifier and Type Method Description CallResult<io.vavr.collection.Seq<CoinbaseError>,Account>
AccountService. getAccount(java.lang.String id)
Get an account by its idCallResult<java.util.List<CoinbaseError>,Account>
AccountService. getAccountAsJava(java.lang.String id)
Get an account by its idCallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage>
AccountService. getAccountsPage()
Get the first accounts pageCallResult<java.util.List<CoinbaseError>,AccountsPage>
AccountService. getAccountsPageAsJava()
Get the first accounts pageCallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage>
AccountService. getNextAccountsPage(Pagination pagination)
Get the next accounts pageCallResult<java.util.List<CoinbaseError>,AccountsPage>
AccountService. getNextAccountsPageAsJava(Pagination pagination)
Get the next accounts pageCallResult<io.vavr.collection.Seq<CoinbaseError>,AccountsPage>
AccountService. getPreviousAccountsPage(Pagination pagination)
Get the previous accounts pageCallResult<java.util.List<CoinbaseError>,AccountsPage>
AccountService. getPreviousAccountsPageAsJava(Pagination pagination)
Get the previous accounts pageCallResult<io.vavr.collection.Seq<CoinbaseError>,Account>
AccountService. updateAccount(java.lang.String id, UpdateAccountRequest request)
Update an account by its idCallResult<java.util.List<CoinbaseError>,Account>
AccountService. updateAccountAsJava(java.lang.String id, UpdateAccountRequest request)
Update an account by its idMethods in com.github.badpop.jcoinbase.service.account that return types with arguments of type CallResult Modifier and Type Method Description protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,PaginatedResponse<Account>>>
CoinbaseAccountService. fetchAccountPageByUri(JCoinbaseClient client, AuthenticationService authentication, java.lang.String uri)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,Account>>
CoinbaseAccountService. send(JCoinbaseClient client, AuthenticationService authentication, java.lang.String uri, java.lang.String httpMethod, java.lang.String httpBody)
-
Uses of CallResult in com.github.badpop.jcoinbase.service.data
Methods in com.github.badpop.jcoinbase.service.data that return CallResult Modifier and Type Method Description CallResult<io.vavr.collection.Seq<CoinbaseError>,io.vavr.collection.Seq<Currency>>
DataService. getCurrencies()
List Coinbase known currencies.CallResult<java.util.List<CoinbaseError>,java.util.List<Currency>>
DataService. getCurrenciesAsJava()
List Coinbase known currencies.CallResult<io.vavr.collection.Seq<CoinbaseError>,ExchangeRates>
DataService. getExchangeRates(java.lang.String currency)
Get current exchange rates for the given currency.CallResult<java.util.List<CoinbaseError>,ExchangeRates>
DataService. getExchangeRatesAsJava(java.lang.String currency)
Get current exchange rates for the given currency.CallResult<io.vavr.collection.Seq<CoinbaseError>,Price>
DataService. getPrice(Price.PriceType priceType, java.lang.String baseCurrency, java.lang.String targetCurrency)
Get the total price to buy one currency with an other currency (e.g.CallResult<java.util.List<CoinbaseError>,Price>
DataService. getPriceAsJava(Price.PriceType priceType, java.lang.String baseCurrency, java.lang.String targetCurrency)
Get the total price to buy one currency with an other currency (e.g.CallResult<io.vavr.collection.Seq<CoinbaseError>,Time>
DataService. getTime()
Get the Coinbase API server time.CallResult<java.util.List<CoinbaseError>,Time>
DataService. getTimeAsJava()
Get the Coinbase API server time.Methods in com.github.badpop.jcoinbase.service.data that return types with arguments of type CallResult Modifier and Type Method Description protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,io.vavr.collection.Seq<Currency>>>
CoinbaseDataService. fetchCurrencies(JCoinbaseClient client)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,ExchangeRates>>
CoinbaseDataService. fetchExchangeRates(JCoinbaseClient client, java.lang.String currency)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,Price>>
CoinbaseDataService. fetchPriceByType(JCoinbaseClient client, Price.PriceType priceType, java.lang.String baseCurrency, java.lang.String targetCurrency)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,Time>>
CoinbaseDataService. fetchTime(JCoinbaseClient client)
-
Uses of CallResult in com.github.badpop.jcoinbase.service.http
Methods in com.github.badpop.jcoinbase.service.http that return CallResult Modifier and Type Method Description static <T> CallResult<io.vavr.collection.Seq<CoinbaseError>,DataDto<T>>
JsonDeserializationService. deserialize(java.net.http.HttpResponse<java.lang.String> response, com.fasterxml.jackson.databind.ObjectMapper jsonSerDes, com.fasterxml.jackson.core.type.TypeReference<DataDto<T>> typeReference)
Generic method to centralized the deserialization process of coinbase api responses and wrap the results in aCallResult
objectstatic <T> CallResult<io.vavr.collection.Seq<CoinbaseError>,PaginatedResponseDto<T>>
JsonDeserializationService. paginatedDeserialize(java.net.http.HttpResponse<java.lang.String> response, com.fasterxml.jackson.databind.ObjectMapper jsonSerDes, com.fasterxml.jackson.core.type.TypeReference<PaginatedResponseDto<T>> typeReference)
static <T> CallResult<io.vavr.collection.Seq<CoinbaseError>,DataDto<T>>
JsonDeserializationService. singleFailureDeserialize(java.net.http.HttpResponse<java.lang.String> response, com.fasterxml.jackson.databind.ObjectMapper jsonSerDes, com.fasterxml.jackson.core.type.TypeReference<DataDto<T>> typeReference)
Generic method to centralized the deserialization process of coinbase api responses and wrap the results in aCallResult
objectMethods in com.github.badpop.jcoinbase.service.http that return types with arguments of type CallResult Modifier and Type Method Description static <T> io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,PaginatedResponseDto<T>>>
HttpRequestSender. paginatedSend(java.net.http.HttpClient httpClient, java.net.http.HttpRequest request, com.fasterxml.jackson.databind.ObjectMapper jsonSerDes, com.fasterxml.jackson.core.type.TypeReference<PaginatedResponseDto<T>> typeReference)
static <T> io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,DataDto<T>>>
HttpRequestSender. send(java.net.http.HttpClient httpClient, java.net.http.HttpRequest request, com.fasterxml.jackson.databind.ObjectMapper jsonSerDes, com.fasterxml.jackson.core.type.TypeReference<DataDto<T>> typeReference)
static <T> io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,DataDto<T>>>
HttpRequestSender. singleFailureSend(java.net.http.HttpClient httpClient, java.net.http.HttpRequest request, com.fasterxml.jackson.databind.ObjectMapper jsonSerDes, com.fasterxml.jackson.core.type.TypeReference<DataDto<T>> typeReference)
-
Uses of CallResult in com.github.badpop.jcoinbase.service.user
Methods in com.github.badpop.jcoinbase.service.user that return CallResult Modifier and Type Method Description CallResult<io.vavr.collection.Seq<CoinbaseError>,Authorizations>
UserService. getAuthorizations()
Get current user’s authorization information including granted scopesCallResult<java.util.List<CoinbaseError>,Authorizations>
UserService. getAuthorizationsAsJava()
Get current user’s authorization information including granted scopesCallResult<io.vavr.collection.Seq<CoinbaseError>,User>
UserService. getCurrentUser()
Get the current user data based on the provided coinbase API Key.CallResult<java.util.List<CoinbaseError>,User>
UserService. getCurrentUserAsJava()
Get the current user data based on the provided coinbase API Key.CallResult<io.vavr.collection.Seq<CoinbaseError>,User>
UserService. getUserById(java.lang.String userId)
Get any user’s public information with their ID.CallResult<java.util.List<CoinbaseError>,User>
UserService. getUserByIdAsJava(java.lang.String userId)
Get any user’s public information with their ID.CallResult<io.vavr.collection.Seq<CoinbaseError>,User>
UserService. updateCurrentUser(UpdateCurrentUserRequest request)
Modify current user and their preferences.CallResult<java.util.List<CoinbaseError>,User>
UserService. updateCurrentUserAsJava(UpdateCurrentUserRequest request)
Modify current user and their preferences.Methods in com.github.badpop.jcoinbase.service.user that return types with arguments of type CallResult Modifier and Type Method Description protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,Authorizations>>
CoinbaseUserService. fetchAuthorizations(JCoinbaseClient client, AuthenticationService authentication)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,User>>
CoinbaseUserService. fetchCurrentUser(JCoinbaseClient client, AuthenticationService authentication)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,User>>
CoinbaseUserService. fetchUserById(JCoinbaseClient client, AuthenticationService authentication, java.lang.String userId)
protected io.vavr.control.Try<CallResult<io.vavr.collection.Seq<CoinbaseError>,User>>
CoinbaseUserService. updateCurrentUser(JCoinbaseClient client, AuthenticationService authentication, UpdateCurrentUserRequest request)