class ImmutableJsonFieldSelectorBuilder implements JsonFieldSelectorBuilder {

    @Override
    public JsonFieldSelectorBuilder addFieldSelectorString(@Nullable final String fieldSelectorString,
            final JsonParseOptions options) {

        requireNonNull(options, "The JSON parse options must not be null!");
        if (null == fieldSelectorString || fieldSelectorString.isEmpty()) {
            return this;
        }

        final JsonFieldSelector fieldSelector = JsonFactory.newFieldSelector(fieldSelectorString, options);
        final boolean arePointersInitiallyEmpty = pointers.isEmpty();
        addPointers(fieldSelector);
        if (arePointersInitiallyEmpty) {
            // We can only set the field selector string if there were no other pointers beforehand.
            jsonFieldSelectorString = fieldSelectorString;
        }

        return this;
    }

    private  ImmutableJsonFieldSelectorBuilder();

}