Package org.restheart.mongodb
Record Class RSOps
java.lang.Object
java.lang.Record
org.restheart.mongodb.RSOps
public record RSOps(com.mongodb.ReadPreference readPreference, com.mongodb.ReadConcern readConcern, com.mongodb.WriteConcern writeConcern)
extends Record
ReplicaSet Connection Options
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.client.MongoDatabaseapply(com.mongodb.client.MongoDatabase db) apply the read concern, read preference and write concern to the given dbcom.mongodb.client.MongoDatabaseapplyReadConcern(com.mongodb.client.MongoDatabase db) com.mongodb.client.MongoDatabaseapplyReadPreference(com.mongodb.client.MongoDatabase db) com.mongodb.client.MongoDatabaseapplyWriteConcern(com.mongodb.client.MongoDatabase db) final booleanIndicates whether some other object is "equal to" this one.static RSOpsfrom(com.mongodb.ConnectionString mongoUri) final inthashCode()Returns a hash code value for this object.com.mongodb.ReadConcernReturns the value of thereadConcernrecord component.com.mongodb.ReadPreferenceReturns the value of thereadPreferencerecord component.final StringtoString()Returns a string representation of this record class.withReadConcern(com.mongodb.ReadConcern readConcern) withReadConcern(String readConcern) withReadPreference(com.mongodb.ReadPreference readPreference) withReadPreference(String readPreference) withWriteConcern(com.mongodb.WriteConcern writeConcern) withWriteConcern(String writeConcern) com.mongodb.WriteConcernReturns the value of thewriteConcernrecord component.
-
Constructor Details
-
RSOps
public RSOps() -
RSOps
public RSOps(com.mongodb.ReadPreference readPreference, com.mongodb.ReadConcern readConcern, com.mongodb.WriteConcern writeConcern) Creates an instance of aRSOpsrecord class.- Parameters:
readPreference- the value for thereadPreferencerecord componentreadConcern- the value for thereadConcernrecord componentwriteConcern- the value for thewriteConcernrecord component
-
-
Method Details
-
withReadPreference
-
withReadPreference
- Throws:
IllegalArgumentException
-
withReadConcern
-
withReadConcern
- Throws:
IllegalArgumentException
-
withWriteConcern
-
withWriteConcern
-
apply
public com.mongodb.client.MongoDatabase apply(com.mongodb.client.MongoDatabase db) apply the read concern, read preference and write concern to the given db- Parameters:
collection-- Returns:
-
applyReadPreference
public com.mongodb.client.MongoDatabase applyReadPreference(com.mongodb.client.MongoDatabase db) -
applyReadConcern
public com.mongodb.client.MongoDatabase applyReadConcern(com.mongodb.client.MongoDatabase db) -
applyWriteConcern
public com.mongodb.client.MongoDatabase applyWriteConcern(com.mongodb.client.MongoDatabase db) -
from
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
readPreference
public com.mongodb.ReadPreference readPreference()Returns the value of thereadPreferencerecord component.- Returns:
- the value of the
readPreferencerecord component
-
readConcern
public com.mongodb.ReadConcern readConcern()Returns the value of thereadConcernrecord component.- Returns:
- the value of the
readConcernrecord component
-
writeConcern
public com.mongodb.WriteConcern writeConcern()Returns the value of thewriteConcernrecord component.- Returns:
- the value of the
writeConcernrecord component
-