Skip to content

Client.Builder class should use reasonable defaults, or fail-fast #76

@kenmccracken

Description

@kenmccracken

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

  1. Have the Client.Builder use reasonable defaults, such as apache HttpProvider, NoAuthorizer, and JacksonSerializer, when no override was specified.
  2. Have the Client.Builder.build() method validate not null with assertions that fail-fast and a clear null indicator.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions