Record Class MongoConfiguration

java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.mongo.MongoConfiguration
Record Components:
connectionString - the database connection string
sslConfiguration - the SSL configuration, may be null if SSL is not used

public record MongoConfiguration(String connectionString, MongoSslConfiguration sslConfiguration) extends Record
The MongoDB configuration record. This contains all necessary information to access the MongoDB instance configured for Namazu Elements
  • Constructor Details

    • MongoConfiguration

      public MongoConfiguration(String connectionString, MongoSslConfiguration sslConfiguration)
      Creates an instance of a MongoConfiguration record class.
      Parameters:
      connectionString - the value for the connectionString record component
      sslConfiguration - the value for the sslConfiguration record component
  • Method Details

    • findSslConfiguration

      public Optional<MongoSslConfiguration> findSslConfiguration()
      Finds the SSL configuration for the MongoDB connection, if any. May be empty if SSL is not configured and the connection is not using SSL.
      Returns:
      the MongoSslConfiguration if SSL is configured, empty otherwise
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • connectionString

      public String connectionString()
      Returns the value of the connectionString record component.
      Returns:
      the value of the connectionString record component
    • sslConfiguration

      public MongoSslConfiguration sslConfiguration()
      Returns the value of the sslConfiguration record component.
      Returns:
      the value of the sslConfiguration record component