12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package com.rthoni.stssaguenay.dbo;
-
- import com.luticate.utils.dbo.LuDbo;
- import com.luticate.utils.dbo.LuPaginatedDbo;
-
- import org.joda.time.LocalDateTime;
- import org.joda.time.LocalTime;
- import org.joda.time.format.DateTimeFormat;
- import org.joda.time.format.DateTimeFormatter;
- import org.json.JSONArray;
- import org.json.JSONException;
- import org.json.JSONObject;
-
- import java.util.HashMap;
- import java.util.List;
- import java.util.Vector;
-
- /**
- * Created by robin on 10/1/16.
- */
-
- public class SchedulesDbo extends LuDbo {
-
- public static class SchedulesDboArray extends LuPaginatedDbo<SchedulesDbo>
- {
- }
-
- protected String _stopId;
-
- protected String _routeId;
-
- protected List<LocalDateTime> _schedules;
-
- @Override
- public void fromJson(JSONObject json) throws JSONException {
- _stopId = json.getString("stopId");
- _routeId = json.getString("routeId");
- _schedules = new Vector<>();
- JSONArray schedules = json.getJSONArray("schedules");
- for (int i = 0; i < schedules.length(); ++i) {
- _schedules.add(LocalDateTime.parse(schedules.getString(i), DateTimeFormat.forPattern("y-M-d H:m:s")));
- }
- }
-
- @Override
- public HashMap<String, Object> toArray() {
- return null;
- }
-
- public String getStopId() {
- return _stopId;
- }
-
- public void setStopId(String stopId) {
- _stopId = stopId;
- }
-
- public String getRouteId() {
- return _routeId;
- }
-
- public void setRouteId(String routeId) {
- _routeId = routeId;
- }
-
- public List<LocalDateTime> getSchedules() {
- return _schedules;
- }
-
- public void setSchedules(List<LocalDateTime> schedules) {
- _schedules = schedules;
- }
- }
|