1
14
15 package com.liferay.portal.service.http;
16
17 import com.liferay.portal.kernel.json.JSONArray;
18 import com.liferay.portal.kernel.json.JSONFactoryUtil;
19 import com.liferay.portal.kernel.json.JSONObject;
20 import com.liferay.portal.model.OrgLabor;
21
22 import java.util.List;
23
24
40 public class OrgLaborJSONSerializer {
41 public static JSONObject toJSONObject(OrgLabor model) {
42 JSONObject jsonObj = JSONFactoryUtil.createJSONObject();
43
44 jsonObj.put("orgLaborId", model.getOrgLaborId());
45 jsonObj.put("organizationId", model.getOrganizationId());
46 jsonObj.put("typeId", model.getTypeId());
47 jsonObj.put("sunOpen", model.getSunOpen());
48 jsonObj.put("sunClose", model.getSunClose());
49 jsonObj.put("monOpen", model.getMonOpen());
50 jsonObj.put("monClose", model.getMonClose());
51 jsonObj.put("tueOpen", model.getTueOpen());
52 jsonObj.put("tueClose", model.getTueClose());
53 jsonObj.put("wedOpen", model.getWedOpen());
54 jsonObj.put("wedClose", model.getWedClose());
55 jsonObj.put("thuOpen", model.getThuOpen());
56 jsonObj.put("thuClose", model.getThuClose());
57 jsonObj.put("friOpen", model.getFriOpen());
58 jsonObj.put("friClose", model.getFriClose());
59 jsonObj.put("satOpen", model.getSatOpen());
60 jsonObj.put("satClose", model.getSatClose());
61
62 return jsonObj;
63 }
64
65 public static JSONArray toJSONArray(
66 com.liferay.portal.model.OrgLabor[] models) {
67 JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
68
69 for (OrgLabor model : models) {
70 jsonArray.put(toJSONObject(model));
71 }
72
73 return jsonArray;
74 }
75
76 public static JSONArray toJSONArray(
77 com.liferay.portal.model.OrgLabor[][] models) {
78 JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
79
80 for (OrgLabor[] model : models) {
81 jsonArray.put(toJSONArray(model));
82 }
83
84 return jsonArray;
85 }
86
87 public static JSONArray toJSONArray(
88 List<com.liferay.portal.model.OrgLabor> models) {
89 JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
90
91 for (OrgLabor model : models) {
92 jsonArray.put(toJSONObject(model));
93 }
94
95 return jsonArray;
96 }
97 }