Record Class FormatSpec
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.datasources.spi.FormatSpec
- Record Components:
format- logical format name (e.g. "csv", "tsv", "parquet")extensions- file extensions with leading dot (e.g. ".csv", ".parquet")
Describes a file format this plugin provides: a logical format name and the
file extensions that select it.
The format name must match a key in the map returned by
DataSourcePlugin.formatReaders(org.elasticsearch.common.settings.Settings). Multiple extensions may map to the
same format (e.g. .ndjson, .jsonl, .json all select
"ndjson"), but each extension should map to exactly one format across
all plugins.
Example:
Set.of(
new FormatSpec("csv", Set.of(".csv")),
new FormatSpec("tsv", Set.of(".tsv"))
)
-
Constructor Summary
ConstructorsConstructorDescriptionFormatSpec(String format, Set<String> extensions) Creates an instance of aFormatSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theextensionsrecord component.format()Returns the value of theformatrecord component.final inthashCode()Returns a hash code value for this object.static FormatSpecConvenience factory for the common single-extension case.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FormatSpec
Creates an instance of aFormatSpecrecord class.- Parameters:
format- the value for theformatrecord componentextensions- the value for theextensionsrecord component
-
-
Method Details
-
of
Convenience factory for the common single-extension case. -
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). -
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
extensions
Returns the value of theextensionsrecord component.- Returns:
- the value of the
extensionsrecord component
-