// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/BigDecimalExtJsonSerializer.java
// public class BigDecimalExtJsonSerializer extends JsonSerializer<BigDecimal> {
//     @Override
//     public void serialize(BigDecimal bigDecimal, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeStringField("$numberDecimal", bigDecimal.toString());
//         jsonGenerator.writeEndObject();
//     }
// }
// 
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/InstantExtJsonSerializer.java
// public class InstantExtJsonSerializer extends JsonSerializer<Instant> {
//     @Override
//     public void serialize(Instant instant, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeNumberField("$date", instant.toEpochMilli());
//         jsonGenerator.writeEndObject();
//     }
// }
// 
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/ObjectIdExtJsonSerializer.java
// public class ObjectIdExtJsonSerializer extends JsonSerializer<ObjectId> {
//     @Override
//     public void serialize(ObjectId objectId, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeStringField("$oid", objectId.toString());
//         jsonGenerator.writeEndObject();
//     }
// }
// 
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/UUIDExtJsonSerializer.java
// public class UUIDExtJsonSerializer extends JsonSerializer<UUID> {
//     @Override
//     public void serialize(UUID uuid, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
//         ByteBuffer uuidBytes = ByteBuffer.wrap(new byte[16]);
//         uuidBytes.putLong(uuid.getMostSignificantBits());
//         uuidBytes.putLong(uuid.getLeastSignificantBits());
// 
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeStringField("$binary", Base64.getEncoder().encodeToString(uuidBytes.array()));
//         jsonGenerator.writeStringField("$type", "4");
//         jsonGenerator.writeEndObject();
//     }
// }


import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.StringSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.BigDecimalExtJsonSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.InstantExtJsonSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.ObjectIdExtJsonSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.UUIDExtJsonSerializer;
import org.bson.types.ObjectId;
import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
import java.util.UUID;
package io.stardog.stardao.mongodb.mapper.jackson.modules;



/**
 * A Jackson module that can serialize objects into "extended JSON", MongoDB's custom JSON format.
 * From extended JSON, we can transform into a Mongo BSON document.
 */
public class ExtendedJsonModule extends SimpleModule {
    public ExtendedJsonModule() {
        super();
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/BigDecimalExtJsonSerializer.java
// public class BigDecimalExtJsonSerializer extends JsonSerializer<BigDecimal> {
//     @Override
//     public void serialize(BigDecimal bigDecimal, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeStringField("$numberDecimal", bigDecimal.toString());
//         jsonGenerator.writeEndObject();
//     }
// }
// 
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/InstantExtJsonSerializer.java
// public class InstantExtJsonSerializer extends JsonSerializer<Instant> {
//     @Override
//     public void serialize(Instant instant, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeNumberField("$date", instant.toEpochMilli());
//         jsonGenerator.writeEndObject();
//     }
// }
// 
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/ObjectIdExtJsonSerializer.java
// public class ObjectIdExtJsonSerializer extends JsonSerializer<ObjectId> {
//     @Override
//     public void serialize(ObjectId objectId, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeStringField("$oid", objectId.toString());
//         jsonGenerator.writeEndObject();
//     }
// }
// 
// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/serializers/extjson/UUIDExtJsonSerializer.java
// public class UUIDExtJsonSerializer extends JsonSerializer<UUID> {
//     @Override
//     public void serialize(UUID uuid, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
//         ByteBuffer uuidBytes = ByteBuffer.wrap(new byte[16]);
//         uuidBytes.putLong(uuid.getMostSignificantBits());
//         uuidBytes.putLong(uuid.getLeastSignificantBits());
// 
//         jsonGenerator.writeStartObject();
//         jsonGenerator.writeStringField("$binary", Base64.getEncoder().encodeToString(uuidBytes.array()));
//         jsonGenerator.writeStringField("$type", "4");
//         jsonGenerator.writeEndObject();
//     }
// }


// Path: stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/mapper/jackson/modules/ExtendedJsonModule.java
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.StringSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.BigDecimalExtJsonSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.InstantExtJsonSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.ObjectIdExtJsonSerializer;
import io.stardog.stardao.mongodb.mapper.jackson.serializers.extjson.UUIDExtJsonSerializer;
import org.bson.types.ObjectId;
import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
import java.util.UUID;

package io.stardog.stardao.mongodb.mapper.jackson.modules;



/**
 * A Jackson module that can serialize objects into "extended JSON", MongoDB's custom JSON format.
 * From extended JSON, we can transform into a Mongo BSON document.
 */
public class ExtendedJsonModule extends SimpleModule {
    public ExtendedJsonModule() {
        super();
        addSerializer(ObjectId.class, new ObjectIdExtJsonSerializer());