forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntry.java
More file actions
143 lines (123 loc) · 4.16 KB
/
Copy pathEntry.java
File metadata and controls
143 lines (123 loc) · 4.16 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package com.gooddata.md;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gooddata.util.*;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.joda.time.DateTime;
/**
* Metadata entry (can be named "LINK" in some API docs)
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Entry {
private final String link;
private final String title;
private final String summary;
private final String category;
private final String author;
private final String contributor;
private final Boolean deprecated;
private final String identifier;
private final String tags; //TODO collection
private final DateTime created;
private final DateTime updated;
private final Boolean locked;
private final Boolean unlisted;
@JsonCreator
public Entry(@JsonProperty("link") String link,
@JsonProperty("title") String title,
@JsonProperty("summary") String summary,
@JsonProperty("category") String category,
@JsonProperty("author") String author,
@JsonProperty("contributor") String contributor,
@JsonProperty("deprecated") @JsonDeserialize(using = BooleanDeserializer.class) Boolean deprecated,
@JsonProperty("identifier") String identifier,
@JsonProperty("tags") String tags,
@JsonProperty("created") @JsonDeserialize(using = GDDateTimeDeserializer.class) DateTime created,
@JsonProperty("updated") @JsonDeserialize(using = GDDateTimeDeserializer.class) DateTime updated,
@JsonProperty("locked") @JsonDeserialize(using = BooleanDeserializer.class) Boolean locked,
@JsonProperty("unlisted") @JsonDeserialize(using = BooleanDeserializer.class) Boolean unlisted) {
this.link = link;
this.title = title;
this.summary = summary;
this.category = category;
this.author = author;
this.contributor = contributor;
this.deprecated = deprecated;
this.identifier = identifier;
this.tags = tags;
this.created = created;
this.updated = updated;
this.locked = locked;
this.unlisted = unlisted;
}
public String getLink() {
return link;
}
public String getTitle() {
return title;
}
public String getSummary() {
return summary;
}
public String getCategory() {
return category;
}
public String getAuthor() {
return author;
}
public String getContributor() {
return contributor;
}
/**
* @return true if the deprecated is set and is true
*/
@JsonIgnore
public boolean isDeprecated() {
return Boolean.TRUE.equals(deprecated);
}
@JsonSerialize(using = BooleanStringSerializer.class)
public Boolean getDeprecated() {
return deprecated;
}
public String getIdentifier() {
return identifier;
}
public String getTags() {
return tags;
}
@JsonSerialize(using = GDDateTimeSerializer.class)
public DateTime getCreated() {
return created;
}
@JsonSerialize(using = GDDateTimeSerializer.class)
public DateTime getUpdated() {
return updated;
}
/**
* @return true if the locked is set and is true
*/
@JsonIgnore
public boolean isLocked() {
return Boolean.TRUE.equals(locked);
}
@JsonSerialize(using = BooleanIntegerSerializer.class)
public Boolean getLocked() {
return locked;
}
/**
* @return true if the unlisted is set and is true
*/
@JsonIgnore
public boolean isUnlisted() {
return Boolean.TRUE.equals(unlisted);
}
@JsonSerialize(using = BooleanIntegerSerializer.class)
public Boolean getUnlisted() {
return unlisted;
}
}