package com.it.rattan.rpc;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Getter
@Setter
public class ObjectRestResponse<T> extends BaseResponse {

    private T Data;

    public ObjectRestResponse(final T data){
        super(SUCCESS,"");
        this.setData(data);
    }

    public ObjectRestResponse(final T data,final String code,final String msg){
        super(code,msg);
        this.setData(data);
    }

    public ObjectRestResponse<T> data(T data){
        this.setData(data);
        return this;
    }

}
