Class JsonConditionalResponseAs<T>

java.lang.Object
com.linecorp.armeria.client.JsonConditionalResponseAs<T>

@UnstableApi public final class JsonConditionalResponseAs<T> extends Object
Provides a way for users to add ResponseAs mappings to transform an aggregated response given that the corresponding Predicate is satisfied. Note that the conditionals are invoked in the order in which they are added.

 RestClient.of(...)
   .get("/")
   .execute(
     ResponseAs.<MyResponse>json(MyMessage.class, res -> res.status().isError())
       .orElseJson(EmptyMessage.class, res -> res.status().isInformational())
       .orElseJson(MyError.class)).join();