Created
March 28, 2019 10:08
-
-
Save namila007/4ac1d43e593ae46b28846ee3fa9d682e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Data | |
public class Resultset<T> | |
{ | |
private HttpStatus status; | |
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss") | |
private LocalDateTime timestamp; | |
private T data; | |
private Resultset() | |
{ | |
this.timestamp = LocalDateTime.now(); | |
} | |
public Resultset( T o, HttpStatus status ) throws ResourceNotFoundException | |
{ | |
this(); | |
if ( o == null || ( o instanceof List && ( ( List ) o ).isEmpty() ) ) | |
throw new ResourceNotFoundException( "No Content Found" ); | |
this.status = status; | |
this.data = o; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment