Class QRecordApiAdapter
java.lang.Object
com.kingsrook.qqq.api.actions.QRecordApiAdapter
Methods for going back and forth from QRecords to API-versions of objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QRecord
apiJsonObjectToQRecord
(org.json.JSONObject jsonObject, String tableName, String apiName, String apiVersion, boolean includeNonEditableFields) static QRecord
apiJsonObjectToQRecord
(org.json.JSONObject jsonObject, String tableName, String apiName, String apiVersion, boolean includeNonEditableFields, InputSource inputSource) static ArrayList
<Map<String, Serializable>> bulk-version of the qRecordToApiMap - will use ApiFieldCustomValueMapperBulkSupportInterface's in the bulky way.version of the qRecordToApiMap that returns QRecords, not maps.qRecordsToApiVersionedQRecordList
(List<QRecord> records, String tableName, String apiName, String apiVersion) version of the qRecordToApiMap that returns QRecords, not maps.static Map
<String, Serializable> qRecordToApiMap
(QRecord record, String tableName, String apiName, String apiVersion) Simple/short form of convert a QRecord to a map for the API - e.g., meant for public consumption.static void
setValueFromApiFieldInQRecord
(org.json.JSONObject apiObject, String apiFieldName, String apiName, Map<String, QFieldMetaData> apiFieldsMap, QRecord qRecord, boolean includeNonEditableFields)
-
Constructor Details
-
QRecordApiAdapter
public QRecordApiAdapter()
-
-
Method Details
-
qRecordToApiMap
public static Map<String,Serializable> qRecordToApiMap(QRecord record, String tableName, String apiName, String apiVersion) throws QException Simple/short form of convert a QRecord to a map for the API - e.g., meant for public consumption.- Throws:
QException
-
qRecordsToApiMapList
public static ArrayList<Map<String,Serializable>> qRecordsToApiMapList(List<QRecord> records, String tableName, String apiName, String apiVersion) throws QException bulk-version of the qRecordToApiMap - will use ApiFieldCustomValueMapperBulkSupportInterface's in the bulky way.- Throws:
QException
-
qRecordsToApiVersionedQRecordList
public static List<QRecord> qRecordsToApiVersionedQRecordList(List<QRecord> records, String tableName, String apiName, String apiVersion) throws QException version of the qRecordToApiMap that returns QRecords, not maps. useful for cases where we're staying inside QQQ, but working with an api- versioned application.- Throws:
QException
-
qRecordsToApiVersionedQRecordList
public static List<QRecord> qRecordsToApiVersionedQRecordList(QRecordApiAdapterToApiInput input) throws QException version of the qRecordToApiMap that returns QRecords, not maps. useful for cases where we're staying inside QQQ, but working with an api- versioned application.- Throws:
QException
-
apiJsonObjectToQRecord
public static QRecord apiJsonObjectToQRecord(org.json.JSONObject jsonObject, String tableName, String apiName, String apiVersion, boolean includeNonEditableFields) throws QException - Throws:
QException
-
apiJsonObjectToQRecord
public static QRecord apiJsonObjectToQRecord(org.json.JSONObject jsonObject, String tableName, String apiName, String apiVersion, boolean includeNonEditableFields, InputSource inputSource) throws QException - Throws:
QException
-
setValueFromApiFieldInQRecord
public static void setValueFromApiFieldInQRecord(org.json.JSONObject apiObject, String apiFieldName, String apiName, Map<String, QFieldMetaData> apiFieldsMap, QRecord qRecord, boolean includeNonEditableFields) throws QException- Throws:
QException
-