Package io.keikai.axyra.sheets.content
Record Class DataConnection
java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.content.DataConnection
public record DataConnection(int id, String name, String kind, String command, String connectionString)
extends Record
A data connection (Power Query or other) read from a workbook's
xl/connections.xml: its id, display name, source kind, command text
and connection string.
kind is one of "oledb", "odbc", "web",
"text", "file", "dao" or "other". Command
text and connection string are editable through
Workbook.setConnectionCommand(java.lang.String, java.lang.String) /
Workbook.setConnectionString(java.lang.String, java.lang.String); the rest of the
connections part is preserved byte-exact.
Read with Workbook.connections(), which
returns snapshots. The setters address a connection by name().
-
Constructor Summary
ConstructorsConstructorDescriptionDataConnection(int id, String name, String kind, String command, String connectionString) Creates an instance of aDataConnectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the value of thecommandrecord component.Returns the value of theconnectionStringrecord component.final booleanIndicates whether some other object is "equal to" this one.static DataConnectionBuilds aDataConnectionfrom a decoded JSON object.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.kind()Returns the value of thekindrecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DataConnection
Creates an instance of aDataConnectionrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentkind- the value for thekindrecord componentcommand- the value for thecommandrecord componentconnectionString- the value for theconnectionStringrecord component
-
-
Method Details
-
fromMap
Builds aDataConnectionfrom a decoded JSON object. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
command
Returns the value of thecommandrecord component.- Returns:
- the value of the
commandrecord component
-
connectionString
Returns the value of theconnectionStringrecord component.- Returns:
- the value of the
connectionStringrecord component
-