// Path: stardao-core/src/main/java/io/stardog/stardao/core/Update.java
// @AutoValue
// @JsonDeserialize(using = UpdateDeserializer.class)
// @JsonSerialize(using = UpdateSerializer.class)
// public abstract class Update<P> {
//     public abstract P getPartial();
//     public abstract Set<String> getSetFields();
//     public abstract Set<String> getRemoveFields();
// 
//     public static <T> Update<T> of(T setObject, Set<String> setFields) {
//         return new AutoValue_Update<>(setObject, setFields, ImmutableSet.of());
//     }
// 
//     public static <T> Update<T> of(T setObject, Set<String> setFields, Set<String> removeFields) {
//         return new AutoValue_Update<>(setObject, setFields, removeFields);
//     }
// 
//     public boolean isEmpty() {
//         return getSetFields().isEmpty() && getRemoveFields().isEmpty();
//     }
// 
//     public Set<String> getUpdateFields() {
//         return Sets.union(getSetFields(), getRemoveFields());
//     }
// 
//     public boolean isUpdateField(String field) {
//         return getSetFields().contains(field) || getRemoveFields().contains(field);
//     }
// }


import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import io.stardog.stardao.core.Update;
package io.stardog.stardao.jackson;


/**
 * This helper lets you quickly construct objects for tests, including using single-quotes/unquoted field names
 * to make it easier to construct JSON strings inline Java.
 *
 * It's not intended to be used for production purposes. Just testing.
 */
public class JsonHelper {
    public static ObjectMapper MAPPER = new ObjectMapper()
            .configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true)
            .configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true)
            .registerModule(new JavaTimeModule())
            .registerModule(new Jdk8Module());

    /**
     * Create an object, given a JSON string and a class.
     * @param json  JSON string
     * @param klazz class of object to create
     * @param <T>   type of object to create
     * @return  object
     */
    public static <T> T obj(String json, Class<T> klazz) {
        try {
            return MAPPER.readValue(json, klazz);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public static <T> T object(String json, Class<T> klazz) {
        return obj(json, klazz);
    }

    /**
     * Create an Update object, given the class of the update type
     * @param json  JSON string
     * @param klazz class of the update type
     * @param <T>   update type
     * @return
     */
// Path: stardao-core/src/main/java/io/stardog/stardao/core/Update.java
// @AutoValue
// @JsonDeserialize(using = UpdateDeserializer.class)
// @JsonSerialize(using = UpdateSerializer.class)
// public abstract class Update<P> {
//     public abstract P getPartial();
//     public abstract Set<String> getSetFields();
//     public abstract Set<String> getRemoveFields();
// 
//     public static <T> Update<T> of(T setObject, Set<String> setFields) {
//         return new AutoValue_Update<>(setObject, setFields, ImmutableSet.of());
//     }
// 
//     public static <T> Update<T> of(T setObject, Set<String> setFields, Set<String> removeFields) {
//         return new AutoValue_Update<>(setObject, setFields, removeFields);
//     }
// 
//     public boolean isEmpty() {
//         return getSetFields().isEmpty() && getRemoveFields().isEmpty();
//     }
// 
//     public Set<String> getUpdateFields() {
//         return Sets.union(getSetFields(), getRemoveFields());
//     }
// 
//     public boolean isUpdateField(String field) {
//         return getSetFields().contains(field) || getRemoveFields().contains(field);
//     }
// }


// Path: stardao-core/src/main/java/io/stardog/stardao/jackson/JsonHelper.java
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import io.stardog.stardao.core.Update;

package io.stardog.stardao.jackson;


/**
 * This helper lets you quickly construct objects for tests, including using single-quotes/unquoted field names
 * to make it easier to construct JSON strings inline Java.
 *
 * It's not intended to be used for production purposes. Just testing.
 */
public class JsonHelper {
    public static ObjectMapper MAPPER = new ObjectMapper()
            .configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true)
            .configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true)
            .registerModule(new JavaTimeModule())
            .registerModule(new Jdk8Module());

    /**
     * Create an object, given a JSON string and a class.
     * @param json  JSON string
     * @param klazz class of object to create
     * @param <T>   type of object to create
     * @return  object
     */
    public static <T> T obj(String json, Class<T> klazz) {
        try {
            return MAPPER.readValue(json, klazz);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public static <T> T object(String json, Class<T> klazz) {
        return obj(json, klazz);
    }

    /**
     * Create an Update object, given the class of the update type
     * @param json  JSON string
     * @param klazz class of the update type
     * @param <T>   update type
     * @return
     */
    public static <T> Update<T> update(String json, Class<T> klazz) {