All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hp.autonomy.searchcomponents.idol.search.IdolRelatedConceptsRequest Maven / Gradle / Ivy

/*
 * 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.searchcomponents.idol.search;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.hp.autonomy.searchcomponents.core.search.QueryRestrictions;
import com.hp.autonomy.searchcomponents.core.search.RelatedConceptsRequest;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.stereotype.Component;

@SuppressWarnings({"FieldMayBeFinal", "WeakerAccess"})
@Data
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonDeserialize(builder = IdolRelatedConceptsRequest.Builder.class)
public class IdolRelatedConceptsRequest implements RelatedConceptsRequest {
    private static final long serialVersionUID = 3450911770365743948L;

    private static final int MAX_RESULTS_DEFAULT = 200;

    private int querySummaryLength;
    private Integer maxResults;
    private QueryRestrictions queryRestrictions;

    @Component
    @JsonPOJOBuilder(withPrefix = "set")
    @Setter
    @Accessors(chain = true)
    @NoArgsConstructor
    public static class Builder implements RelatedConceptsRequest.Builder {
        private int querySummaryLength = 0;
        private Integer maxResults = MAX_RESULTS_DEFAULT;
        private QueryRestrictions queryRestrictions;
        
        public Builder(final RelatedConceptsRequest relatedConceptsRequest) {
            querySummaryLength = relatedConceptsRequest.getQuerySummaryLength();
            queryRestrictions = relatedConceptsRequest.getQueryRestrictions();
        }

        @Override
        public IdolRelatedConceptsRequest build() {
            return new IdolRelatedConceptsRequest(querySummaryLength, maxResults, queryRestrictions);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy