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
-
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.client.MongoDatabase
apply
(com.mongodb.client.MongoDatabase db) apply the read concern, read preference and write concern to the given dbcom.mongodb.client.MongoDatabase
applyReadConcern
(com.mongodb.client.MongoDatabase db) com.mongodb.client.MongoDatabase
applyReadPreference
(com.mongodb.client.MongoDatabase db) com.mongodb.client.MongoDatabase
applyWriteConcern
(com.mongodb.client.MongoDatabase db) final boolean
Indicates whether some other object is "equal to" this one.static RSOps
from
(com.mongodb.ConnectionString mongoUri) final int
hashCode()
Returns a hash code value for this object.com.mongodb.ReadConcern
Returns the value of thereadConcern
record component.com.mongodb.ReadPreference
Returns the value of thereadPreference
record component.final String
toString()
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.WriteConcern
Returns the value of thewriteConcern
record 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 aRSOps
record class.- Parameters:
readPreference
- the value for thereadPreference
record componentreadConcern
- the value for thereadConcern
record componentwriteConcern
- the value for thewriteConcern
record 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 thereadPreference
record component.- Returns:
- the value of the
readPreference
record component
-
readConcern
public com.mongodb.ReadConcern readConcern()Returns the value of thereadConcern
record component.- Returns:
- the value of the
readConcern
record component
-
writeConcern
public com.mongodb.WriteConcern writeConcern()Returns the value of thewriteConcern
record component.- Returns:
- the value of the
writeConcern
record component
-