Record Class ConnectorConfig
java.lang.Object
java.lang.Record
com.darkcollective.relix.processor.connector.ConnectorConfig
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 Summary
ConstructorsConstructorDescriptionConnectorConfig(Map<String, String> values) Creates an instance of aConnectorConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectorConfigempty()An empty configuration.final booleanIndicates whether some other object is "equal to" this one.getOrDefault(String key, String defaultValue) final inthashCode()Returns a hash code value for this object.Returns the value forkey, failing when it is absent — for keys a connector cannot operate without (e.g.final StringtoString()Returns a string representation of this record class.values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
ConnectorConfig
Creates an instance of aConnectorConfigrecord class.- Parameters:
values- the value for thevaluesrecord component
-
-
Method Details
-
empty
An empty configuration. -
get
- Parameters:
key- the configuration key- Returns:
- the value if present, otherwise empty
-
getOrDefault
- Parameters:
key- the configuration keydefaultValue- the value to return whenkeyis absent- Returns:
- the configured value, or
defaultValuewhen absent
-
require
Returns the value forkey, failing when it is absent — for keys a connector cannot operate without (e.g.urlfor JDBC).- Parameters:
key- the required configuration key- Returns:
- the configured value
- Throws:
EvaluationException- if the key is missing
-
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). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-