1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.json.JSONArray;
26 import com.liferay.portal.kernel.json.JSONFactoryUtil;
27 import com.liferay.portal.kernel.json.JSONObject;
28 import com.liferay.portal.model.OrgLabor;
29
30 import java.util.List;
31
32
51 public class OrgLaborJSONSerializer {
52 public static JSONObject toJSONObject(OrgLabor model) {
53 JSONObject jsonObj = JSONFactoryUtil.createJSONObject();
54
55 jsonObj.put("orgLaborId", model.getOrgLaborId());
56 jsonObj.put("organizationId", model.getOrganizationId());
57 jsonObj.put("typeId", model.getTypeId());
58 jsonObj.put("sunOpen", model.getSunOpen());
59 jsonObj.put("sunClose", model.getSunClose());
60 jsonObj.put("monOpen", model.getMonOpen());
61 jsonObj.put("monClose", model.getMonClose());
62 jsonObj.put("tueOpen", model.getTueOpen());
63 jsonObj.put("tueClose", model.getTueClose());
64 jsonObj.put("wedOpen", model.getWedOpen());
65 jsonObj.put("wedClose", model.getWedClose());
66 jsonObj.put("thuOpen", model.getThuOpen());
67 jsonObj.put("thuClose", model.getThuClose());
68 jsonObj.put("friOpen", model.getFriOpen());
69 jsonObj.put("friClose", model.getFriClose());
70 jsonObj.put("satOpen", model.getSatOpen());
71 jsonObj.put("satClose", model.getSatClose());
72
73 return jsonObj;
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(toJSONObject(model));
82 }
83
84 return jsonArray;
85 }
86
87 public static JSONArray toJSONArray(
88 com.liferay.portal.model.OrgLabor[][] models) {
89 JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
90
91 for (OrgLabor[] model : models) {
92 jsonArray.put(toJSONArray(model));
93 }
94
95 return jsonArray;
96 }
97
98 public static JSONArray toJSONArray(
99 List<com.liferay.portal.model.OrgLabor> models) {
100 JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
101
102 for (OrgLabor model : models) {
103 jsonArray.put(toJSONObject(model));
104 }
105
106 return jsonArray;
107 }
108 }