1 package com.foxinmy.weixin4j.model.media;
2
3 import java.io.Serializable;
4 import java.util.List;
5
6 import com.alibaba.fastjson.annotation.JSONField;
7 import com.foxinmy.weixin4j.model.paging.Pageable;
8 import com.foxinmy.weixin4j.model.paging.Pagedata;
9 import com.foxinmy.weixin4j.type.MediaType;
10
11
12
13
14
15
16
17
18
19
20 public class MediaRecord implements Serializable {
21
22 private static final long serialVersionUID = 7017503153256241457L;
23
24
25
26
27 @JSONField(name = "total_count")
28 private int totalCount;
29
30
31
32 @JSONField(name = "item_count")
33 private int itemCount;
34
35
36
37 @JSONField(serialize = false, deserialize = false)
38 private MediaType mediaType;
39
40
41
42 @JSONField(name = "items")
43 private List<MediaItem> items;
44
45
46
47 @JSONField(serialize = false, deserialize = false)
48 private Pageable pageable;
49 @JSONField(serialize = false, deserialize = false)
50 private volatile Pagedata<MediaItem> pagedata;
51
52 public int getTotalCount() {
53 return totalCount;
54 }
55
56 public void setTotalCount(int totalCount) {
57 this.totalCount = totalCount;
58 }
59
60 public int getItemCount() {
61 return itemCount;
62 }
63
64 public void setItemCount(int itemCount) {
65 this.itemCount = itemCount;
66 }
67
68 public MediaType getMediaType() {
69 return mediaType;
70 }
71
72 public void setMediaType(MediaType mediaType) {
73 this.mediaType = mediaType;
74 }
75
76 public List<MediaItem> getItems() {
77 return items;
78 }
79
80 public void setItems(List<MediaItem> items) {
81 this.items = items;
82 }
83
84 public Pageable getPageable() {
85 return pageable;
86 }
87
88 public void setPageable(Pageable pageable) {
89 this.pageable = pageable;
90 }
91
92 public Pagedata<MediaItem> getPagedata() {
93 if (pagedata == null) {
94 pagedata = new Pagedata<MediaItem>(pageable, totalCount, items);
95 }
96 return pagedata;
97 }
98
99 @Override
100 public String toString() {
101 return "MediaRecord [totalCount=" + totalCount + ", itemCount="
102 + itemCount + ", mediaType=" + mediaType + ", items=" + items
103 + ", pageable=" + pageable + "]";
104 }
105 }