br.com.anteros.nosql.persistence.mongodb.session.MongoUpdateResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-NoSql-Persistence-MongoDB Show documentation
Show all versions of Anteros-NoSql-Persistence-MongoDB Show documentation
Anteros NoSQL Persistence MongoDB.
package br.com.anteros.nosql.persistence.mongodb.session;
import com.mongodb.client.result.UpdateResult;
import br.com.anteros.nosql.persistence.session.NoSQLResult;
public class MongoUpdateResult implements NoSQLResult {
protected long modifiedCount;
protected UpdateResult updateResult;
public static MongoUpdateResult of(UpdateResult updateResult) {
return new MongoUpdateResult(updateResult);
}
public static MongoUpdateResult of(long modifiedCount) {
return new MongoUpdateResult(modifiedCount);
}
protected MongoUpdateResult(long modifiedCount) {
this.modifiedCount = modifiedCount;
}
protected MongoUpdateResult(UpdateResult updateResult) {
this.updateResult = updateResult;
}
@Override
public long getModifiedOrDeletedCount() {
if (updateResult!=null)
return updateResult.getModifiedCount();
return modifiedCount;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy