cn.schoolwow.util.domain.query.jsonobject.QueryJSONObjectResponse Maven / Gradle / Ivy
package cn.schoolwow.util.domain.query.jsonobject;
import cn.schoolwow.quickflow.QuickFlowBuilder;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.util.module.query.jsonobject.domain.JSONObjectQueryOption;
import cn.schoolwow.util.module.query.jsonobject.service.GetJSONObjectFieldsValueFlow;
public class QueryJSONObjectResponse {
private JSONObjectQueryOption jsonObjectQueryOption;
public QueryJSONObjectResponse(JSONObjectQueryOption jsonObjectQueryOption) {
this.jsonObjectQueryOption = jsonObjectQueryOption;
}
/**获取指定字段值*/
public Object getFieldValue(String fieldName){
Object fieldValue = jsonObjectQueryOption.object.get(fieldName);
return fieldValue;
}
/**获取指定多个字段值*/
public Object getMultipleFieldValue(String... fieldNames){
FlowContext flowContext = QuickFlowBuilder.quickFlow().startFlow(new GetJSONObjectFieldsValueFlow())
.putCurrentCompositeFlowData("jsonObjectQueryOption", jsonObjectQueryOption)
.putCurrentCompositeFlowData("fieldNames", fieldNames)
.execute();
Object fieldValue = flowContext.getData("fieldValue");
return fieldValue;
}
}