/
ProjectItem.java
73 lines (58 loc) · 1.71 KB
/
ProjectItem.java
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
package org.rundeck.client.api.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Created by greg on 5/19/16.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProjectItem {
private String name;
private String description;
private String url;
private Map<String, String> config;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Map<String, String> getConfig() {
return config;
}
public void setConfig(Map<String, String> config) {
this.config = config;
}
public Map<Object, Object> toMap() {
HashMap<Object, Object> detail = new LinkedHashMap<>();
detail.put("name", getName());
detail.put("description", description != null && !"".equals(description.trim()) ? description : "");
detail.put("url", getUrl());
if (null != getConfig()) {
detail.put("config", getConfig());
}
return detail;
}
public String toBasicString() {
return String.format(
"%s%s",
name,
description != null && !"".equals(description.trim()) ? ": " + description : ""
);
}
}