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

com.hp.autonomy.searchcomponents.hod.parametricvalues.HodParametricRequest 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.hod.parametricvalues;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.hp.autonomy.hod.client.api.resource.ResourceIdentifier;
import com.hp.autonomy.searchcomponents.core.parametricvalues.ParametricRequest;
import com.hp.autonomy.searchcomponents.core.search.QueryRestrictions;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Collections;
import java.util.Set;

@Data
@NoArgsConstructor
@JsonDeserialize(builder = HodParametricRequest.Builder.class)
public class HodParametricRequest implements ParametricRequest {
    private static final long serialVersionUID = 2235023046934181036L;

    private Set fieldNames;
    @SuppressWarnings("InstanceVariableOfConcreteClass")
    private QueryRestrictions queryRestrictions;
    private ResourceIdentifier queryProfile;

    private HodParametricRequest(final Set fieldNames, final QueryRestrictions queryRestrictions, final ResourceIdentifier queryProfile) {
        this.fieldNames = fieldNames == null ? Collections.emptySet() : fieldNames;
        this.queryRestrictions = queryRestrictions;
        this.queryProfile = queryProfile;
    }

    @JsonPOJOBuilder(withPrefix = "set")
    @Setter
    @Accessors(chain = true)
    @NoArgsConstructor
    public static class Builder {
        private Set fieldNames;
        private ResourceIdentifier queryProfile;
        @SuppressWarnings("InstanceVariableOfConcreteClass")
        private QueryRestrictions queryRestrictions;

        public Builder(final HodParametricRequest hodParametricRequest) {
            fieldNames = hodParametricRequest.getFieldNames();
            queryRestrictions = hodParametricRequest.getQueryRestrictions();
            queryProfile = hodParametricRequest.getQueryProfile();
        }

        public HodParametricRequest build() {
            return new HodParametricRequest(fieldNames, queryRestrictions, queryProfile);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy