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

com.hp.autonomy.hod.client.api.analysis.sentiment.SentimentAnalysisResponse Maven / Gradle / Ivy

There is a newer version: 0.25.3
Show newest version
/*
 * Copyright 2015-2016 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.hod.client.api.analysis.sentiment;

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.List;

/**
 * Holds the response from the SentimentAnalysis API
 */
@Data
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@JsonDeserialize(builder = SentimentAnalysisResponse.Builder.class)
public class SentimentAnalysisResponse {

    /**
     * @return Entities containing positive sentiment
     */
    private final List positive;

    /**
     * @return Entities containing negative sentiment
     */
    private final List negative;

    /**
     * @return Aggregate sentiment of the text
     */
    private final SentimentAnalysisAggregate aggregate;

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

        private List positive;
        private List negative;
        private SentimentAnalysisAggregate aggregate;

        public SentimentAnalysisResponse build() {
            return new SentimentAnalysisResponse(positive, negative, aggregate);
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy