Extended data structure
package eu.fasten.analyzer.qualityanalyzer.data;
+import org.jooq.JSONB;
import org.jooq.Record;
import org.json.JSONObject;
public class CallableHolder {
- private JSONObject callableMetadata = null;
+ //Fields in the callables table
+ private Long callableId = null;
+ private Long moduleId = null;
+ private String fastenUri = null;
+ private boolean is_internal_call = false;
+ private Long createdAt = null;
private Integer line_start = null;
private Integer line_end = null;
+ private JSONObject callableMetadata = null;
- private String fastenUri = null;
- private Long moduleId;
- private boolean is_internal = true;
- private Long callableId = null;
+ public CallableHolder(Record dbRecord) {
- private String partialType = null;
+ callableId = (Long) dbRecord.get(0);
+ moduleId = (Long) dbRecord.get(1);
+ fastenUri = (String) dbRecord.get(2);
+ is_internal_call = (boolean) dbRecord.get(3);
- public CallableHolder(JSONObject payload) {
- line_start = Integer.parseInt(payload.get(QAConstants.LINE_START).toString());
- line_end = Integer.parseInt(payload.get(QAConstants.LINE_END).toString());
- partialType = payload.get(QAConstants.RETURN_TYPE).toString();
- }
+ createdAt = (Long) dbRecord.get(4);
+ line_start = (Integer) dbRecord.get(5);
+ line_end = (Integer) dbRecord.get(6);
- public JSONObject getCallableMetadata() {
- return callableMetadata;
- }
+ JSONB metadata = (JSONB) dbRecord.get(7);
+ callableMetadata = new JSONObject(metadata.data());
- public Integer getLine_start() {
- return line_start;
}
- public Integer getLine_end() {
- return line_end;
+ public Long getCallableId() {
+ return callableId;
}
public Long getModuleId() {
return moduleId;
}
+ public String getFastenUri(){
+ return fastenUri;
+ }
+
public boolean isInternal() {
- return is_internal;
+ return is_internal_call;
}
- public String getFastenUri(){
- return fastenUri;
+ public Long getCreatedAt() {
+ return createdAt;
+ }
+
+ public Integer getLine_start() {
+ return line_start;
}
- //JSON object contains partial return type
- public String getPartialType() {
- return partialType;
+ public Integer getLine_end() {
+ return line_end;
}
- public void setValues(Record cr) {
- callableId = (Long) cr.get(0);
- moduleId = (Long) cr.get(1);
- fastenUri = (String) cr.get(2);
- is_internal = (boolean) cr.get(3);
+ public JSONObject getCallableMetadata() {
+ return callableMetadata;
}
+
}
