// Path: src/main/java/de/danielbasedow/prospecter/core/MatchCondition.java
// public enum MatchCondition {
//     EQUALS,
//     LESS_THAN,
//     GREATER_THAN,
//     LESS_THAN_EQUALS,
//     GREATER_THAN_EQUALS,
//     NONE,
//     IN,
//     RADIUS
// }
// 
// Path: src/main/java/de/danielbasedow/prospecter/core/query/InvalidQueryException.java
// public class InvalidQueryException extends RuntimeException {
//     public InvalidQueryException(String msg) {
//         super(msg);
//     }
// 
//     public InvalidQueryException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// }


import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import de.danielbasedow.prospecter.core.MatchCondition;
import de.danielbasedow.prospecter.core.query.InvalidQueryException;
package de.danielbasedow.prospecter.core.query.build;


public class AbstractFieldHandler implements FieldHandler {
    protected final ObjectNode root;
    protected final String fieldName;

    public AbstractFieldHandler(ObjectNode node, String fieldName) {
        root = node;
        this.fieldName = fieldName;
    }

    protected MatchCondition getMatchCondition(String comparator) {
        if ("gt".equals(comparator)) {
            return MatchCondition.GREATER_THAN;
        } else if ("gte".equals(comparator)) {
            return MatchCondition.GREATER_THAN_EQUALS;
        } else if ("lt".equals(comparator)) {
            return MatchCondition.LESS_THAN;
        } else if ("lte".equals(comparator)) {
            return MatchCondition.LESS_THAN_EQUALS;
        } else if ("eq".equals(comparator)) {
            return MatchCondition.EQUALS;
        } else {
            return MatchCondition.NONE;
        }
    }

    protected JsonNode getValue() {
        JsonNode valNode = root.get("value");
        if (valNode == null) {
// Path: src/main/java/de/danielbasedow/prospecter/core/MatchCondition.java
// public enum MatchCondition {
//     EQUALS,
//     LESS_THAN,
//     GREATER_THAN,
//     LESS_THAN_EQUALS,
//     GREATER_THAN_EQUALS,
//     NONE,
//     IN,
//     RADIUS
// }
// 
// Path: src/main/java/de/danielbasedow/prospecter/core/query/InvalidQueryException.java
// public class InvalidQueryException extends RuntimeException {
//     public InvalidQueryException(String msg) {
//         super(msg);
//     }
// 
//     public InvalidQueryException(String msg, Throwable cause) {
//         super(msg, cause);
//     }
// }


// Path: src/main/java/de/danielbasedow/prospecter/core/query/build/AbstractFieldHandler.java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import de.danielbasedow.prospecter.core.MatchCondition;
import de.danielbasedow.prospecter.core.query.InvalidQueryException;

package de.danielbasedow.prospecter.core.query.build;


public class AbstractFieldHandler implements FieldHandler {
    protected final ObjectNode root;
    protected final String fieldName;

    public AbstractFieldHandler(ObjectNode node, String fieldName) {
        root = node;
        this.fieldName = fieldName;
    }

    protected MatchCondition getMatchCondition(String comparator) {
        if ("gt".equals(comparator)) {
            return MatchCondition.GREATER_THAN;
        } else if ("gte".equals(comparator)) {
            return MatchCondition.GREATER_THAN_EQUALS;
        } else if ("lt".equals(comparator)) {
            return MatchCondition.LESS_THAN;
        } else if ("lte".equals(comparator)) {
            return MatchCondition.LESS_THAN_EQUALS;
        } else if ("eq".equals(comparator)) {
            return MatchCondition.EQUALS;
        } else {
            return MatchCondition.NONE;
        }
    }

    protected JsonNode getValue() {
        JsonNode valNode = root.get("value");
        if (valNode == null) {
            throw new InvalidQueryException("No value node found");