![JAR search and dependency download from the Maven repository](/logo.png)
com.despegar.integration.mongo.id.StringIdGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongo-connector Show documentation
Show all versions of mongo-connector Show documentation
Helper component to connect to mongo fast and easy
package com.despegar.integration.mongo.id;
import org.apache.commons.lang.StringUtils;
import org.bson.types.ObjectId;
public class StringIdGenerator
implements IdGenerator {
public String generateId(String collectionName) {
return new ObjectId().toString();
}
public Boolean validateId(Object id) {
return id != null ? !StringUtils.isEmpty(id.toString()) : Boolean.FALSE;
}
public void updateId(String collectionName, Object id) {
// nothing to do
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy