here-aaa-java-sdk
here-aaa-java-sdk copied to clipboard
Client.Builder class should use reasonable defaults, or fail-fast
Currently, the Client.Builder() class allows you to construct an instance without specifying, for example, a Serializer. The result is you get what appears to be a valid Client, but later when you send requests, they fail at the serialization step with a NullPointerException.
A Client instance that can be constructed, but cannot be used, is rather of pointless.
The solution should either
- Have the Client.Builder use reasonable defaults, such as apache HttpProvider, NoAuthorizer, and JacksonSerializer, when no override was specified.
- Have the Client.Builder.build() method validate not null with assertions that fail-fast and a clear null indicator.