forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGdc.java
More file actions
91 lines (75 loc) · 2.4 KB
/
Copy pathGdc.java
File metadata and controls
91 lines (75 loc) · 2.4 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
/*
* Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
*/
package com.gooddata.gdc;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonTypeInfo;
import org.codehaus.jackson.annotate.JsonTypeName;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import java.util.Collection;
import java.util.List;
/**
*/
@JsonTypeName("about")
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class Gdc {
public static final String URI = "/gdc";
private final String category;
private final String summary;
private final List<Link> links;
@JsonCreator
public Gdc(@JsonProperty("category") String category, @JsonProperty("summary") String summary,
@JsonProperty("links") List<Link> links) {
this.category = category;
this.summary = summary;
this.links = links;
}
public String getCategory() {
return category;
}
public String getSummary() {
return summary;
}
public Collection<Link> getLinks() {
return links;
}
public Link getLink(String category) {
for (Link link: links) {
if (category.equals(link.getCategory())) {
return link;
}
}
return null;
}
@JsonIgnoreProperties(ignoreUnknown = true)
public static class Link {
private final String category;
private final String link;
private final String summary;
private final String title;
@JsonCreator
public Link(@JsonProperty("category") String category, @JsonProperty("link") String link,
@JsonProperty("summary") String summary, @JsonProperty("title") String title) {
this.category = category;
this.link = link;
this.summary = summary;
this.title = title;
}
public String getCategory() {
return category;
}
public String getLink() {
return link;
}
public String getSummary() {
return summary;
}
public String getTitle() {
return title;
}
}
}