Created
March 10, 2017 15:46
-
-
Save DenisZm/98de85ead2f12fe32cee62b7bb3b4752 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.royalrangers.bean; | |
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
import lombok.Getter; | |
import java.io.Serializable; | |
@Getter | |
public class ResultResponse implements Serializable { | |
private Object data = new EmptyJsonResponse(); | |
private boolean success = false; | |
public ResultResponse(boolean success, Object data) { | |
this.data = data; | |
this.success = success; | |
} | |
public ResultResponse(boolean success, String message) { | |
this.data = new ResponseMessage(message); | |
this.success = success; | |
} | |
public ResultResponse(boolean success) { | |
this.success = success; | |
} | |
@JsonSerialize | |
public class EmptyJsonResponse { } | |
@Getter | |
public class ResponseMessage implements Serializable{ | |
private String message; | |
ResponseMessage (String message) { | |
this.message = message; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment