Skip to content

Commit 7005adf

Browse files
committed
Resolved #204 DTO: Setters of Scheduler job dto package return void
1 parent e89f20e commit 7005adf

32 files changed

+1091
-1147
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.jaspersoft.jasperserver.jaxrs.client.dto.common;
2+
3+
/**
4+
* <p/>
5+
* <p/>
6+
*
7+
* @author tetiana.iefimenko
8+
* @version $Id$
9+
* @see
10+
*/
11+
public interface DeepCloneable<T> {
12+
T deepClone();
13+
}

src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/jobs/CalendarTrigger.java

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import com.jaspersoft.jasperserver.jaxrs.client.dto.jobs.jaxb.adapters.DaysByteXmlAdapter;
2525
import com.jaspersoft.jasperserver.jaxrs.client.dto.jobs.jaxb.adapters.MonthsByteXmlAdapter;
2626

27+
import java.util.Iterator;
28+
import java.util.TreeSet;
2729
import javax.xml.bind.annotation.XmlRootElement;
2830
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
2931
import java.util.SortedSet;
@@ -38,54 +40,82 @@ public class CalendarTrigger extends JobTrigger {
3840
private String monthDays;
3941
private SortedSet<Byte> months;
4042

43+
public CalendarTrigger() {
44+
super();
45+
}
46+
47+
public CalendarTrigger(CalendarTrigger other) {
48+
super(other);
49+
this.minutes = other.minutes;
50+
this.hours = other.hours;
51+
this.daysType = other.daysType;
52+
this.weekDays = new TreeSet<Byte>();
53+
Iterator<Byte> iterator = other.weekDays.iterator();
54+
while (iterator.hasNext()) {
55+
this.weekDays.add(iterator.next());
56+
}
57+
this.monthDays = other.monthDays;
58+
this.months = new TreeSet<Byte>();
59+
Iterator<Byte> monthItertor = other.months.iterator();
60+
while (monthItertor.hasNext()) {
61+
this.months.add(iterator.next());
62+
}
63+
}
64+
4165
public String getMinutes() {
4266
return minutes;
4367
}
4468

45-
public void setMinutes(String minutes) {
69+
public CalendarTrigger setMinutes(String minutes) {
4670
this.minutes = minutes;
71+
return this;
4772
}
4873

4974
public String getHours() {
5075
return hours;
5176
}
5277

53-
public void setHours(String hours) {
78+
public CalendarTrigger setHours(String hours) {
5479
this.hours = hours;
80+
return this;
5581
}
5682

5783
public String getMonthDays() {
5884
return monthDays;
5985
}
6086

61-
public void setMonthDays(String monthDays) {
87+
public CalendarTrigger setMonthDays(String monthDays) {
6288
this.monthDays = monthDays;
89+
return this;
6390
}
6491

6592
public CalendarDaysType getDaysType() {
6693
return daysType;
6794
}
6895

69-
public void setDaysType(CalendarDaysType daysType) {
96+
public CalendarTrigger setDaysType(CalendarDaysType daysType) {
7097
this.daysType = daysType;
98+
return this;
7199
}
72100

73101
@XmlJavaTypeAdapter(DaysByteXmlAdapter.class)
74102
public SortedSet<Byte> getWeekDays() {
75103
return weekDays;
76104
}
77105

78-
public void setWeekDays(SortedSet<Byte> weekDays) {
106+
public CalendarTrigger setWeekDays(SortedSet<Byte> weekDays) {
79107
this.weekDays = weekDays;
108+
return this;
80109
}
81110

82111
@XmlJavaTypeAdapter(MonthsByteXmlAdapter.class)
83112
public SortedSet<Byte> getMonths() {
84113
return months;
85114
}
86115

87-
public void setMonths(SortedSet<Byte> months) {
116+
public CalendarTrigger setMonths(SortedSet<Byte> months) {
88117
this.months = months;
118+
return this;
89119
}
90120

91121
@Override

src/main/java/com/jaspersoft/jasperserver/jaxrs/client/dto/jobs/FtpInfo.java

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,111 +22,146 @@
2222
package com.jaspersoft.jasperserver.jaxrs.client.dto.jobs;
2323

2424

25+
import java.util.LinkedHashMap;
2526
import javax.xml.bind.annotation.XmlRootElement;
2627
import java.util.Map;
2728

2829
@XmlRootElement(name = "outputFTPInfo")
2930
public class FtpInfo {
3031

31-
private String userName;
32-
private String password;
33-
private String folderPath;
34-
private String serverName;
35-
private FtpType type;
36-
private String protocol;
37-
private Integer port;
38-
private Boolean implicit;
39-
private Long pbsz;
40-
private String prot;
41-
private Map<String, String> propertiesMap;
42-
32+
protected String userName;
33+
protected String password;
34+
protected String folderPath;
35+
protected String serverName;
36+
protected FtpType type;
37+
protected String protocol;
38+
protected Integer port;
39+
protected Boolean implicit;
40+
protected Long pbsz;
41+
protected String prot;
42+
protected Map<String, String> propertiesMap;
43+
44+
public FtpInfo() {
45+
}
46+
47+
public FtpInfo(FtpInfo other) {
48+
this.folderPath = other.folderPath;
49+
this.implicit = other.implicit;
50+
this.password = other.password;
51+
this.pbsz = other.pbsz;
52+
this.port = other.port;
53+
this.propertiesMap = new LinkedHashMap<String, String>();
54+
for (Map.Entry<String, String> entry: other.propertiesMap.entrySet()) {
55+
this.propertiesMap.put(entry.getKey(), entry.getValue());
56+
}
57+
this.prot = other.prot;
58+
this.protocol = other.protocol;
59+
this.serverName = other.serverName;
60+
this.type = other.type;
61+
this.userName = other.userName;
62+
}
4363

4464
public String getUserName() {
4565
return userName;
4666
}
4767

48-
public void setUserName(String userName) {
68+
public FtpInfo setUserName(String userName) {
4969
this.userName = userName;
70+
return this;
71+
}
72+
73+
public Boolean getImplicit() {
74+
return implicit;
5075
}
5176

5277
public String getPassword() {
5378
return password;
5479
}
5580

56-
public void setPassword(String password) {
81+
public FtpInfo setPassword(String password) {
5782
this.password = password;
83+
return this;
5884
}
5985

6086
public String getFolderPath() {
6187
return folderPath;
6288
}
6389

64-
public void setFolderPath(String folderPath) {
90+
public FtpInfo setFolderPath(String folderPath) {
6591
this.folderPath = folderPath;
92+
return this;
6693
}
6794

6895
public String getServerName() {
6996
return serverName;
7097
}
7198

72-
public void setServerName(String serverName) {
99+
public FtpInfo setServerName(String serverName) {
73100
this.serverName = serverName;
101+
return this;
74102
}
75103

76104
public FtpType getType() {
77105
return type;
78106
}
79107

80-
public void setType(FtpType type) {
108+
public FtpInfo setType(FtpType type) {
81109
this.type = type;
110+
return this;
82111
}
83112

84113
public String getProtocol() {
85114
return protocol;
86115
}
87116

88-
public void setProtocol(String protocol) {
117+
public FtpInfo setProtocol(String protocol) {
89118
this.protocol = protocol;
119+
return this;
90120
}
91121

92122
public Integer getPort() {
93123
return port;
94124
}
95125

96-
public void setPort(Integer port) {
126+
public FtpInfo setPort(Integer port) {
97127
this.port = port;
128+
return this;
98129
}
99130

100131
public Boolean isImplicit() {
101132
return implicit;
102133
}
103134

104-
public void setImplicit(Boolean implicit) {
135+
public FtpInfo setImplicit(Boolean implicit) {
105136
this.implicit = implicit;
137+
return this;
106138
}
107139

108140
public Long getPbsz() {
109141
return pbsz;
110142
}
111143

112-
public void setPbsz(Long pbsz) {
144+
public FtpInfo setPbsz(Long pbsz) {
113145
this.pbsz = pbsz;
146+
return this;
114147
}
115148

116149
public String getProt() {
117150
return prot;
118151
}
119152

120-
public void setProt(String prot) {
153+
public FtpInfo setProt(String prot) {
121154
this.prot = prot;
155+
return this;
122156
}
123157

124158
public Map<String, String> getPropertiesMap() {
125159
return propertiesMap;
126160
}
127161

128-
public void setPropertiesMap(Map<String, String> propertiesMap) {
162+
public FtpInfo setPropertiesMap(Map<String, String> propertiesMap) {
129163
this.propertiesMap = propertiesMap;
164+
return this;
130165
}
131166

132167
@Override

0 commit comments

Comments
 (0)