java.lang.Object
java.lang.Record
com.darkcollective.relix.processor.connector.ConnectorConfig

public record ConnectorConfig(Map<String,String> values) extends Record
The raw, type-agnostic configuration for one connector-backed relation — the key/value pairs from a connection or source declaration, already environment-substituted.

Each RelixConnector defines its own keys: a JDBC connector reads url/user/password; a file connector reads path; a MongoDB connector reads uri/database. Keeping the config untyped means a new connector needs no change to the registry or the declaration AST — it simply documents and reads the keys it understands.

Keys are looked up case-sensitively (the connection-declaration parser owns the canonical key names). Instances are immutable.

  • Constructor Details

    • ConnectorConfig

      public ConnectorConfig(Map<String,String> values)
      Creates an instance of a ConnectorConfig record class.
      Parameters:
      values - the value for the values record component
  • Method Details

    • empty

      public static ConnectorConfig empty()
      An empty configuration.
    • get

      public Optional<String> get(String key)
      Parameters:
      key - the configuration key
      Returns:
      the value if present, otherwise empty
    • getOrDefault

      public String getOrDefault(String key, String defaultValue)
      Parameters:
      key - the configuration key
      defaultValue - the value to return when key is absent
      Returns:
      the configured value, or defaultValue when absent
    • require

      public String require(String key)
      Returns the value for key, failing when it is absent — for keys a connector cannot operate without (e.g. url for JDBC).
      Parameters:
      key - the required configuration key
      Returns:
      the configured value
      Throws:
      EvaluationException - if the key is missing
    • 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.
    • values

      public Map<String,String> values()
      Returns the value of the values record component.
      Returns:
      the value of the values record component