All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.util.domain.query.jsonobject.QueryJSONObjectResponse Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy