Record Class QuerySettings.QuerySettingDef<T>
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.esql.plan.QuerySettings.QuerySettingDef<T>
- Type Parameters:
T- The type of the setting value.- Record Components:
name- The name to be used when setting it in the query. E.g.SET name=valuetype- The allowed datatype of the setting.serverlessOnly-preview-snapshotOnly-description- The user-facing description of the setting.validator- A validation function to check the setting value. Defaults to calling theparserand returning the error message of any exception it throws.parser- A function to parse the setting value into the final object.defaultValueSupplier- A supplier of the default value to be used when the setting is not set.
- Enclosing class:
QuerySettings
public static record QuerySettings.QuerySettingDef<T>(String name, DataType type, boolean serverlessOnly, boolean preview, boolean snapshotOnly, String description, QuerySettings.QuerySettingDef.Validator validator, QuerySettings.QuerySettingDef.Parser<T> parser, Function<RemoteClusterService,T> defaultValueSupplier)
extends Record
Definition of a query setting.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Constructor Summary
ConstructorsConstructorDescriptionQuerySettingDef(String name, DataType type, boolean serverlessOnly, boolean preview, boolean snapshotOnly, String description, QuerySettings.QuerySettingDef.Parser<T> parser, Function<RemoteClusterService, T> defaultValueSupplier) QuerySettingDef(String name, DataType type, boolean serverlessOnly, boolean preview, boolean snapshotOnly, String description, QuerySettings.QuerySettingDef.Validator validator, QuerySettings.QuerySettingDef.Parser<T> parser, Function<RemoteClusterService, T> defaultValueSupplier) Creates an instance of aQuerySettingDefrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultValueSupplierrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.get(Expression value, RemoteClusterService clusterService) final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.parser()Returns the value of theparserrecord component.booleanpreview()Returns the value of thepreviewrecord component.booleanReturns the value of theserverlessOnlyrecord component.booleanReturns the value of thesnapshotOnlyrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Returns the value of thevalidatorrecord component.
-
Constructor Details
-
QuerySettingDef
public QuerySettingDef(String name, DataType type, boolean serverlessOnly, boolean preview, boolean snapshotOnly, String description, QuerySettings.QuerySettingDef.Parser<T> parser, Function<RemoteClusterService, T> defaultValueSupplier) -
QuerySettingDef
public QuerySettingDef(String name, DataType type, boolean serverlessOnly, boolean preview, boolean snapshotOnly, String description, QuerySettings.QuerySettingDef.Validator validator, QuerySettings.QuerySettingDef.Parser<T> parser, Function<RemoteClusterService, T> defaultValueSupplier) Creates an instance of aQuerySettingDefrecord class.- Parameters:
name- the value for thenamerecord componenttype- the value for thetyperecord componentserverlessOnly- the value for theserverlessOnlyrecord componentpreview- the value for thepreviewrecord componentsnapshotOnly- the value for thesnapshotOnlyrecord componentdescription- the value for thedescriptionrecord componentvalidator- the value for thevalidatorrecord componentparser- the value for theparserrecord componentdefaultValueSupplier- the value for thedefaultValueSupplierrecord component
-
-
Method Details
-
get
-
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
serverlessOnly
public boolean serverlessOnly()Returns the value of theserverlessOnlyrecord component.- Returns:
- the value of the
serverlessOnlyrecord component
-
preview
public boolean preview()Returns the value of thepreviewrecord component.- Returns:
- the value of the
previewrecord component
-
snapshotOnly
public boolean snapshotOnly()Returns the value of thesnapshotOnlyrecord component.- Returns:
- the value of the
snapshotOnlyrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
validator
Returns the value of thevalidatorrecord component.- Returns:
- the value of the
validatorrecord component
-
parser
Returns the value of theparserrecord component.- Returns:
- the value of the
parserrecord component
-
defaultValueSupplier
Returns the value of thedefaultValueSupplierrecord component.- Returns:
- the value of the
defaultValueSupplierrecord component
-