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

com.codingapi.springboot.framework.dto.response.SingleResponse Maven / Gradle / Ivy

There is a newer version: 3.3.12
Show newest version
package com.codingapi.springboot.framework.dto.response;

import lombok.Getter;
import lombok.Setter;

/**
 * @author lorne
 * 2020/12/17
 */
@Setter
@Getter
public class SingleResponse extends Response {

    private T data;

    public static  SingleResponse of(T data) {
        SingleResponse singleResponse = new SingleResponse<>();
        singleResponse.setSuccess(true);
        singleResponse.setData(data);
        return singleResponse;
    }


    public static  SingleResponse empty() {
        SingleResponse singleResponse = new SingleResponse<>();
        singleResponse.setSuccess(true);
        singleResponse.setData(null);
        return singleResponse;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy