Java 类org.bson.codecs.ObjectIdGenerator 实例源码

项目:bsoncodec-apt    文件:HierarchyTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new UserCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:ArrayTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new Array1PojoCodec(new ObjectIdGenerator()),
                    new Array1PojoFixedCodec(new ObjectIdGenerator()),
                    new Array2PojoCodec(new ObjectIdGenerator()),
                    new Array2PojoFixedCodec(new ObjectIdGenerator()),
                    new Array3PojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:CharacterPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new CharacterPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:StringPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new StringPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:ShortPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new ShortPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:LongPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new LongPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:MonthPojoTest.java   
@Override
@SuppressWarnings("unchecked")
public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) {
    if (clazz.equals(MonthPojo.class)) {
        return (Codec<T>) new MonthPojoCodec(registry, new ObjectIdGenerator());
    }
    return null;
}
项目:bsoncodec-apt    文件:AtomicBooleanPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new AtomicBooleanPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:DatePojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new DatePojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:TransientTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new TransientPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:AtomicIntegerPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new AtomicIntegerPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:BooleanPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new BooleanPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:Decimal128PojoTest.java   
@Override
@SuppressWarnings("unchecked")
public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) {
    if (clazz.equals(Decimal128Pojo.class)) {
        return (Codec<T>) new Decimal128PojoCodec(new ObjectIdGenerator());
    }
    return null;
}
项目:bsoncodec-apt    文件:UnknownTest.java   
private MongoDatabase connect() {
    ObjectIdGenerator objectIdGenerator = new ObjectIdGenerator();
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(),
                    CodecRegistries.fromCodecs(
                            new UnknownIgnorePojoCodec(objectIdGenerator),
                            new UnknownFailPojoCodec(objectIdGenerator)));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:YearPojoTest.java   
@Override
@SuppressWarnings("unchecked")
public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) {
    if (clazz.equals(YearPojo.class)) {
        return (Codec<T>) new YearPojoCodec(registry, new ObjectIdGenerator());
    }
    return null;
}
项目:bsoncodec-apt    文件:DoublePojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new DoublePojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:FloatPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new FloatPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:EnumPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new EnumPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:BytePojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries.fromRegistries(
            MongoClient.getDefaultCodecRegistry(),
            CodecRegistries.fromCodecs(new BytePojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:InstantPojoTest.java   
@Override
@SuppressWarnings("unchecked")
public <T> Codec<T> get(final Class<T> clazz, final CodecRegistry registry) {
    if (clazz.equals(InstantPojo.class)) {
        return (Codec<T>) new InstantPojoCodec(registry, new ObjectIdGenerator());
    }
    return null;
}
项目:bsoncodec-apt    文件:AtomicLongPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new AtomicLongPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:IntegerPojoTest.java   
private MongoDatabase connect() {
    CodecRegistry codecRegistry = CodecRegistries
            .fromRegistries(MongoClient.getDefaultCodecRegistry(), CodecRegistries
                    .fromCodecs(new IntegerPojoCodec(new ObjectIdGenerator())));

    MongoDatabase db = getMongoClient().getDatabase("pojo")
            .withCodecRegistry(codecRegistry);
    return db;
}
项目:bsoncodec-apt    文件:PojoCodecProvider.java   
public PojoCodecProvider() {
  this(new ObjectIdGenerator());
}
项目:bsoncodec-apt    文件:PojoCodecProvider.java   
public PojoCodecProvider(final ObjectIdGenerator objectIdGenerator) {
  this.objectIdGenerator = objectIdGenerator;
}
项目:bsoncodec-apt    文件:SimpleCodec.java   
public SimpleCodec(final ObjectIdGenerator objectIdGenerator) {
  this.objectIdGenerator = Assertions.notNull("objectIdGenerator", objectIdGenerator);
}