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

com.hazelcast.com.jayway.jsonpath.internal.function.json.KeySetFunction Maven / Gradle / Ivy

There is a newer version: 5.4.0
Show newest version
package com.hazelcast.com.jayway.jsonpath.internal.function.json;

import com.hazelcast.com.jayway.jsonpath.internal.EvaluationContext;
import com.hazelcast.com.jayway.jsonpath.internal.PathRef;
import com.hazelcast.com.jayway.jsonpath.internal.function.Parameter;
import com.hazelcast.com.jayway.jsonpath.internal.function.PathFunction;

import java.util.List;

/**
 * Author: Sergey Saiyan [email protected]
 * Created at 21/02/2018.
 */
public class KeySetFunction implements PathFunction {

    @Override
    public Object invoke(String currentPath, PathRef parent, Object model, EvaluationContext ctx, List parameters) {
        if (ctx.configuration().jsonProvider().isMap(model)) {
            return ctx.configuration().jsonProvider().getPropertyKeys(model);
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy