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

net.leanix.dropkit.responses.Response Maven / Gradle / Ivy

There is a newer version: 2.0.10
Show newest version
package net.leanix.dropkit.responses;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/**
 * A generic entity container for api responses.
 *
 *
 *
 * @param 
 * @deprecated
 */
@JsonInclude(Include.NON_NULL)
public abstract class Response extends BasicResponse {

    protected T data;

    public Response() {
        super();
    }

    /**
     * Constructor for a result containing a single entity.
     *
     * @param entity
     */
    public Response(T entity) {
        status = ResponseStatus.OK;
        data = entity;
        type = entity.getClass().getSimpleName();
    }

    @JsonInclude
    public abstract T getData();

    public void setData(T data) {
        this.data = data;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy