Skip to content

Commit 087eff2

Browse files
author
Jarkko Laitinen
committed
Refactored CanBeRelocated and added field Priority. Priority will replace profit in a future version. Profit is deprecated from now on.
1 parent 1655c4d commit 087eff2

File tree

2 files changed

+47
-23
lines changed

2 files changed

+47
-23
lines changed

fi/cosky/sdk/TaskData.java

+24-11
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ public class TaskData extends BaseData {
1818
private int VersionNumber;
1919
private List<String> IncompatibleVehicleTypes;
2020
private List<String> CompatibleVehicleTypes;
21+
22+
//Profit will be removed at some point, use Priority.
23+
@Deprecated
2124
private double Profit;
22-
private String CanBeRelocated;
25+
26+
private double Priority;
27+
private String RelocationType;
2328
private String ActivityState;
2429

2530
public TaskData() {
26-
this.CanBeRelocated = "None";
31+
this.RelocationType = "None";
2732
this.ActivityState = "Active"; // other possibility is "Inactive"
2833
}
2934

@@ -95,14 +100,6 @@ public void setProfit(double profit) {
95100
Profit = profit;
96101
}
97102

98-
public String getCanBeRelocated() {
99-
return CanBeRelocated;
100-
}
101-
102-
public void setCanBeRelocated(String canBeRelocated) {
103-
CanBeRelocated = canBeRelocated;
104-
}
105-
106103
public String getActivityState() {
107104
return ActivityState;
108105
}
@@ -111,6 +108,22 @@ public void setActivityState(String activityState) {
111108
ActivityState = activityState;
112109
}
113110

111+
public double getPriority() {
112+
return Priority;
113+
}
114+
115+
public void setPriority(double priority) {
116+
Priority = priority;
117+
}
118+
119+
public String getRelocationType() {
120+
return RelocationType;
121+
}
122+
123+
public void setRelocationType(String relocationType) {
124+
RelocationType = relocationType;
125+
}
126+
114127
public TaskUpdateRequest toRequest() {
115128
List<TaskEventUpdateRequest> taskevents = new ArrayList<TaskEventUpdateRequest>();
116129

@@ -123,7 +136,7 @@ public TaskUpdateRequest toRequest() {
123136
update.setName(Name);
124137
update.setVersionNumber(VersionNumber);
125138
update.setTaskId(Id);
126-
update.setCanBeRelocated(CanBeRelocated);
139+
update.setRelocationType(RelocationType);
127140
update.setActivityState(ActivityState);
128141
return update;
129142
}

fi/cosky/sdk/TaskUpdateRequest.java

+23-12
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,22 @@ public class TaskUpdateRequest extends BaseData {
1919
private int UserId;
2020
private List<String> IncompatibleVehicleTypes;
2121
private List<String> CompatibleVehicleTypes;
22+
23+
@Deprecated
2224
private double Profit;
23-
private String CanBeRelocated;
25+
26+
private double Priority;
27+
private String RelocationType;
2428
private String ActivityState;
2529

2630

2731
public TaskUpdateRequest(List<TaskEventUpdateRequest> taskEvents) {
2832
this.TaskEvents = taskEvents;
29-
this.CanBeRelocated = "None";
33+
this.RelocationType = "None";
3034
}
3135

3236
public TaskUpdateRequest() {
33-
this.CanBeRelocated = "None";
37+
this.RelocationType = "None";
3438
}
3539

3640
public String getInfo() {
@@ -105,7 +109,6 @@ public void setTaskEvents(List<TaskEventUpdateRequest> taskEvents) {
105109
TaskEvents = taskEvents;
106110
}
107111

108-
109112
public double getProfit() {
110113
return Profit;
111114
}
@@ -114,14 +117,6 @@ public void setProfit(double profit) {
114117
Profit = profit;
115118
}
116119

117-
public String getCanBeRelocated() {
118-
return CanBeRelocated;
119-
}
120-
121-
public void setCanBeRelocated(String canBeRelocated) {
122-
CanBeRelocated = canBeRelocated;
123-
}
124-
125120
public String getActivityState() {
126121
return ActivityState;
127122
}
@@ -130,5 +125,21 @@ public void setActivityState(String activityState) {
130125
ActivityState = activityState;
131126
}
132127

128+
public double getPriority() {
129+
return Priority;
130+
}
131+
132+
public void setPriority(double priority) {
133+
Priority = priority;
134+
}
135+
136+
public String getRelocationType() {
137+
return RelocationType;
138+
}
139+
140+
public void setRelocationType(String relocationType) {
141+
RelocationType = relocationType;
142+
}
143+
133144

134145
}

0 commit comments

Comments
 (0)