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

JavaVertXWebServer.supportFiles.ApiResponse.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
package {{invokerPackage}};

public class ApiResponse {
    private final T data;
    private final int statusCode;

    public ApiResponse() {
        this(200, null);
    }

    public ApiResponse(T data) {
        this(200, data);
    }

    public ApiResponse(int statusCode) {
        this(statusCode, null);
    }

    public ApiResponse(int statusCode, T data) {
        this.statusCode = statusCode;
        this.data = data;
    }

    public boolean hasData() {
        return data != null;
    }

    public T getData() {
        return data;
    }

    public int getStatusCode() {
        return statusCode;
    }
}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy