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

com.jrodeo.bson.marshallers.ObjectIdMarshaller Maven / Gradle / Ivy

Go to download

A tool to create Java marshallers to and from bson. Currently used in a data access layer serialize Json to Bson for MongoDB storage.

There is a newer version: 0.9.15
Show newest version
package com.jrodeo.bson.marshallers;

import org.bson.BsonReader;
import org.bson.BsonWriter;
import org.bson.types.ObjectId;

public class ObjectIdMarshaller extends AbstractSimpleMarshaller {

    @Override
    public Class getForClass() {
        return ObjectId.class;
    }

    @Override
    public void write(BsonWriter writer, ObjectId obj) {
        writer.writeObjectId(obj);
    }

    @Override
    public ObjectId read(BsonReader reader) {
        return reader.readObjectId();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy