-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAssetPojo.java
More file actions
77 lines (59 loc) · 1.99 KB
/
AssetPojo.java
File metadata and controls
77 lines (59 loc) · 1.99 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.contentstack.cms.stack;
import java.util.Map;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AssetPojo {
@SerializedName("uid")
private String uid;
@SerializedName("title")
private String title;
@SerializedName("content_type")
private String contentType;
@SerializedName("file_size")
private String fileSize;
@SerializedName("filename")
private String filename;
@SerializedName("url")
private String url;
@SerializedName("description")
private String description;
@SerializedName("_version")
private int version;
@SerializedName("is_dir")
private boolean isDir;
@SerializedName("tags")
private String[] tags;
@SerializedName("name")
private String name;
// Store any unknown/dynamic fields
@Expose(serialize = false, deserialize = false)
private transient Map<String, Object> additionalFields;
public Map<String, Object> getAdditionalFields() {
return additionalFields;
}
public void setAdditionalFields(Map<String, Object> additionalFields) {
this.additionalFields = additionalFields;
}
// Getters
public String getUid() { return uid; }
public String getTitle() {
if (contentType.equals("application/vnd.contenstack.folder")) {
return name;
}
return title; }
public String getContentType() { return contentType; }
public String getFileSize() { return fileSize; }
public String getFilename() { return filename; }
public String getUrl() { return url; }
public String getDescription() { return description; }
public int getVersion() { return version; }
public boolean isDir() { return isDir; }
public String[] getTags() { return tags; }
@Override
public String toString() {
return new com.google.gson.GsonBuilder()
.setPrettyPrinting()
.create()
.toJson(this);
}
}