<commit_before>/*
 * Copyright 2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.iod.client.api.search;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Collections;
import java.util.List;

/**
 * Top level response from the QueryTextIndex API and FindSimilar API.
 */
@Data
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonDeserialize(builder = Documents.Builder.class)
public class Documents {

    /**
     * @returns The list of documents returned by IDOL OnDemand
     */
    private final List<Document> documents;

    /**
     * @returns The total number of results found by IDOL OnDemand. If the total_results parameter was not specified,
     * this will be 0.
     */
    private final int totalResults;

    @Setter
    @Accessors(chain = true)
    @JsonPOJOBuilder(withPrefix = "set")
    public static class Builder {

        @SuppressWarnings("FieldMayBeFinal")
        private List<Document> documents = Collections.emptyList();

        private int totalResults;

        @JsonProperty("totalhits")
        public Builder setTotalResults(final int totalResults) {
            this.totalResults = totalResults;
            return this;
        }

        public Documents build() {
            return new Documents(documents, totalResults);
        }

    }
<commit_msg>Box totalResults as otherwise 0 is the default which is a valid value.<commit_after>/*
 * Copyright 2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.iod.client.api.search;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Collections;
import java.util.List;

/**
 * Top level response from the QueryTextIndex API and FindSimilar API.
 */
@Data
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonDeserialize(builder = Documents.Builder.class)
public class Documents {

    /**
     * @returns The list of documents returned by IDOL OnDemand
     */
    private final List<Document> documents;

    /**
     * @returns The total number of results found by IDOL OnDemand. If the total_results parameter was not specified,
     * this will be 0.
     */
    private final Integer totalResults;

    @Setter
    @Accessors(chain = true)
    @JsonPOJOBuilder(withPrefix = "set")
    public static class Builder {

        @SuppressWarnings("FieldMayBeFinal")
        private List<Document> documents = Collections.emptyList();

        private Integer totalResults;

        @JsonProperty("totalhits")
        public Builder setTotalResults(final int totalResults) {
            this.totalResults = totalResults;
            return this;
        }

        public Documents build() {
            return new Documents(documents, totalResults);
        }

    }

{'fraction_non_alphanumeric': 0.08472655143100029, 'fraction_numerical': 0.0031170303202040237, 'mean_word_length': 3.4235588972431077, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5396252', 'n_tokens_mistral': 993, 'n_tokens_neox': 923, 'n_words': 288}