RecallRequestResponse.java 927 Bytes
package com.yoho.search.models.recall;

import com.alibaba.fastjson.JSON;
import com.yoho.search.base.utils.Transfer;
import com.yoho.search.cache.model.AbstractCacheRequestResponse;

public class RecallRequestResponse extends AbstractCacheRequestResponse<RecallRequest,RecallResponse> {

    public RecallRequestResponse(RecallRequest request) {
        super(request);
    }

    public static Transfer<String,RecallResponse> toResponseTransfer = (jsonValue)-> JSON.parseObject(jsonValue, RecallResponse.class);

    public static Transfer<RecallResponse,String> fromResponseTransfer =(recallResponse)-> JSON.toJSONString(recallResponse);

    @Override
    public Transfer<String, RecallResponse> getToResponseTransfer() {
        return toResponseTransfer;
    }

    @Override
    public Transfer<RecallResponse, String> getFromResponseTransfer() {
        return fromResponseTransfer;
    }

}