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

com.codingapi.springboot.framework.dto.response.MapResponse 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;

import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
public class MapResponse extends Response {

    private Map data;

    public MapResponse() {
        this.data = new HashMap<>();
    }

    public static MapResponse create() {
        MapResponse singleResponse = new MapResponse();
        singleResponse.setSuccess(true);
        return singleResponse;
    }

    public static MapResponse empty() {
        MapResponse mapResponse = new MapResponse();
        mapResponse.setSuccess(true);
        mapResponse.setData(null);
        return mapResponse;
    }

    public MapResponse add(String key, Object value) {
        this.data.put(key, value);
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy