RecallMergerResult.java 3.12 KB
package com.yoho.search.models.recall;

import com.yoho.search.service.recall.strategy.StrategyEnum;

import java.util.List;

/**
 * 召回的合并结果
 */
public class RecallMergerResult {

    private long total;
    private List<SknResult> sknList;

    public RecallMergerResult(long total, List<SknResult> sknList) {
        this.total = total;
        this.sknList = sknList;
    }

    public long getTotal() {
        return total;
    }

    public List<SknResult> getSknList() {
        return sknList;
    }

    public static class SknResult {

        private Integer productSkn;
        private String intervalKey;

        private StrategyEnum strategy;
        private Integer brandId;
        private Integer middleSortId;
        private Integer priceArea;
        private Integer heatValue;
        private String factor;

        private Double score;
        private boolean likePriceArea;
        private boolean onlyOneStrategy;

        public SknResult(Integer productSkn,String intervalKey) {
            this.productSkn = productSkn;
            this.intervalKey = intervalKey;
            this.likePriceArea = false;
        }

        /**************************set*******************************/
        public void setBySknBaseInfo(SknBaseInfoResponse sknBaseInfoResponse) {
            this.brandId = sknBaseInfoResponse.getBrandId();
            this.middleSortId = sknBaseInfoResponse.getMisortId();
            this.priceArea = sknBaseInfoResponse.getPriceArea();
            this.heatValue = sknBaseInfoResponse.getHeatValue();
            this.factor = sknBaseInfoResponse.getProductFeatureFactor();
        }

        public void setStrategy(StrategyEnum strategy) {
            this.strategy = strategy;
        }

        public void setOnlyOneStrategy(boolean onlyOneStrategy) {
            this.onlyOneStrategy = onlyOneStrategy;
        }

        public void setScore(Double score) {
            this.score = score;
        }

        public void setLikePriceArea(boolean likePriceArea) {
            this.likePriceArea = likePriceArea;
        }

        /**************************get*******************************/
        public Integer getProductSkn() {
            return productSkn;
        }

        public String getIntervalKey() {
            return intervalKey;
        }

        public Integer getBrandId() {
            return brandId;
        }

        public Integer getMiddleSortId() {
            return middleSortId;
        }

        public Integer getPriceArea() {
            return priceArea;
        }

        public StrategyEnum getStrategy() {
            return strategy;
        }

        public Double getScore() {
            return score;
        }

        public String getFactor() {
            return factor;
        }

        public boolean isLikePriceArea() {
            return likePriceArea;
        }

        public Integer getHeatValue() {
            return heatValue;
        }

        public boolean isOnlyOneStrategy() {
            return onlyOneStrategy;
        }
    }

}