class ImmutableSearchResult implements SearchResult {

    public static ImmutableSearchResult fromJson(final JsonObject jsonObject) {
        final JsonArray extractedItems = jsonObject.getValueOrThrow(JsonFields.ITEMS);
        final Long extractedNextPageOffset = jsonObject.getValue(JsonFields.NEXT_PAGE_OFFSET).orElse(null);
        final String extractedCursor = jsonObject.getValue(JsonFields.CURSOR).orElse(null);

        return of(extractedItems, extractedNextPageOffset, extractedCursor);
    }

    private  ImmutableSearchResult(final JsonArray items, @Nullable final Long nextPageOffset,
            @Nullable final String cursor);

}