-
Notifications
You must be signed in to change notification settings - Fork 0
/
ManagementService.java
87 lines (68 loc) · 2.01 KB
/
ManagementService.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package edu.tamu.app.model;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Enumerated;
import javax.persistence.MappedSuperclass;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonView;
import edu.tamu.app.model.converter.CryptoConverter;
import edu.tamu.app.model.validation.ManagementServiceValidator;
import edu.tamu.weaver.response.ApiView;
import edu.tamu.weaver.validation.model.ValidatingBaseEntity;
@MappedSuperclass
public abstract class ManagementService extends ValidatingBaseEntity {
@Column(nullable = false)
@JsonView(ApiView.Partial.class)
@JsonInclude(Include.NON_NULL)
protected String name;
@Enumerated
@JsonView(ApiView.Partial.class)
@JsonInclude(Include.NON_NULL)
protected ServiceType type;
@Column
@JsonIgnore
@JsonView(ApiView.Partial.class)
protected String url;
@Column
@JsonIgnore
@JsonView(ApiView.Partial.class)
@Convert(converter = CryptoConverter.class)
protected String token;
public ManagementService() {
super();
modelValidator = new ManagementServiceValidator();
}
public ManagementService(String name, ServiceType type, String url, String token) {
this();
this.name = name;
this.type = type;
this.url = url;
this.token = token;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ServiceType getType() {
return type;
}
public void setType(ServiceType type) {
this.type = type;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}