Package com.commercetools.docs.meta
Class GeneralConcept
java.lang.Object
com.commercetools.docs.meta.GeneralConcept
Table of content
- General concept of the SDK
- ApiHttpClient
- ApiRoot & ProjectApiRoot
- ApiMethod
- Models
General concept of the SDK
The SDK provides classes and interfaces to interact with the commercetools Composable Commerce APIs in an object-oriented way.ApiHttpClient
TheApiHttpClient
defines the interface to interact with the API. It executes requests
and maps the response to the correct class and returns it. The ApiHttpClient supports multiple different HTTP client
implementations and can the behavior can be adjusted using middlewares
.
ApiRoot & ProjectApiRoot
TheApiRoot
and ProjectApiRoot
provide a way
to explore the functionality of the API while coding. All endpoints are reachable using the chainable calls from
the API root as like as the URI hierarchy of the API describes them. All request builder instances are immutable.
ApiMethod
For every resource endpoint and HTTP method a specificApiMethod
exists. It specifies
the request type and the response return type. Also these classes define methods for the possible query parameters.
The `with` methods set the parameter to the specified value and drop already defined ones. The `add` methods will
add an additional parameter with the specified value. The ApiMethod classes are immutable.
The ApiMethod.execute()
and RequestCommand.executeBlocking()
can be used to directly execute the request
using the configured ApiHttpClient. ApiMethod.send()
and ApiMethod.sendBlocking()
will execute the
request and return the response as byte array instead of mapping it.
Models
Each domain model is defined as an interface. The interface describes the getters and setters. Allannotations
necessary for serializing or deserializing are defined at the interface. For each interface exists an implementation
class with the suffix Impl and a builder class with the suffix Builder. The interface has factory methods
for both.
Additionally there is a withModelName method. This allows to execute a function which takes the model instance
itself and maps it to a new type e.g. like type safe accessing of attribute values.-
Constructor Summary
-
Method Summary
-
Constructor Details
-
GeneralConcept
public GeneralConcept()
-