-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathListResponse.java
More file actions
47 lines (37 loc) · 1.14 KB
/
ListResponse.java
File metadata and controls
47 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.flutterwave.bean;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.GsonBuilder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
public class ListResponse {
private String status;
private String message;
private Meta meta;
private List<Data> data;
private List<BillSummary> summary;
private String error_id;
private String code;
public static ListResponse toListResponse(String value){
return new GsonBuilder().create().
fromJson(value, ListResponse.class);
}
@Override
public String toString() {
String value = null;
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
try {
value = objectMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return value;
}
}