Class Features


public class Features extends Object
Table of content


Embracing Java 8

The SDK API uses:

Request builders

The SDK provides a request builder which allows to explore the API while writing the program.

ProjectApiRoot apiRoot = createProjectClient();
final CompletableFuture<ApiHttpResponse<TaxCategoryPagedQueryResponse>> future = apiRoot.taxCategories()
        .withWhere("name = :name")
        .withPredicateVar("name", "de19")

See the test code.

The request method objects are immutable as shown in this example.

ProjectApiRoot apiRoot = createProjectClient();
final ByProjectKeyTaxCategoriesGet taxCategoriesGet = apiRoot.taxCategories()
        .withWhere("name = :name")
        .withPredicateVar("name", "de19");

final ByProjectKeyTaxCategoriesGet taxCategoriesGet2 = taxCategoriesGet.withPredicateVar("name", "de07");


See the test code.

Good defaults for equals() and hashCode()

The SDK's model implementation classes provide default implementations for the methods.

Client interfaces

The HTTP client abstract itself is a functional interface and can be replaced with test doubles.

Model factory methods

Each model has a factory method ::of() to create a new empty instance. The method ::builder() returns a new builder instance.


The client supports middlewares to adjust request and responses while being executed. A middleware is a functional interface which has the request and the next middleware as an argument and returns a CompletableFuture with the response. The following example shows how to add an additional header.

ProjectApiRoot apiRoot = ApiRootBuilder.of()
        .addMiddleware((request, next) -> next.apply(request.addHeader("X-FOO", "Bar")))

See the test code.

The authentication, logging and other functionality has been implemented in middlewares and is added by default to the HandlerStack in the ClientBuilder

  • Constructor Details

    • Features

      public Features()