Module org.elasticsearch.server
Package org.elasticsearch.search.fetch
Record Class StoredFieldsSpec
java.lang.Object
java.lang.Record
org.elasticsearch.search.fetch.StoredFieldsSpec
- Record Components:
requiresSource
- should source be loadedrequiredStoredFields
- a set of stored fields to load
public record StoredFieldsSpec(boolean requiresSource, boolean requiresMetadata, Set<String> requiredStoredFields)
extends Record
Defines which stored fields need to be loaded during a fetch
-
Field Summary
Modifier and TypeFieldDescriptionstatic final StoredFieldsSpec
Use when the source should be loaded but no other stored fields are requiredstatic final StoredFieldsSpec
Use when no stored fields are required -
Constructor Summary
ConstructorDescriptionStoredFieldsSpec
(boolean requiresSource, boolean requiresMetadata, Set<String> requiredStoredFields) Creates an instance of aStoredFieldsSpec
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> StoredFieldsSpec
build
(Collection<T> sources, Function<T, StoredFieldsSpec> converter) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.merge
(StoredFieldsSpec other) Combine these stored field requirements with those from another StoredFieldsSpecboolean
Returns the value of therequiredStoredFields
record component.boolean
Returns the value of therequiresMetadata
record component.boolean
Returns the value of therequiresSource
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
NO_REQUIREMENTS
Use when no stored fields are required -
NEEDS_SOURCE
Use when the source should be loaded but no other stored fields are required
-
-
Constructor Details
-
StoredFieldsSpec
public StoredFieldsSpec(boolean requiresSource, boolean requiresMetadata, Set<String> requiredStoredFields) Creates an instance of aStoredFieldsSpec
record class.- Parameters:
requiresSource
- the value for therequiresSource
record componentrequiresMetadata
- the value for therequiresMetadata
record componentrequiredStoredFields
- the value for therequiredStoredFields
record component
-
-
Method Details
-
noRequirements
public boolean noRequirements() -
merge
Combine these stored field requirements with those from another StoredFieldsSpec -
build
public static <T> StoredFieldsSpec build(Collection<T> sources, Function<T, StoredFieldsSpec> converter) -
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 '=='. -
requiresSource
public boolean requiresSource()Returns the value of therequiresSource
record component.- Returns:
- the value of the
requiresSource
record component
-
requiresMetadata
public boolean requiresMetadata()Returns the value of therequiresMetadata
record component.- Returns:
- the value of the
requiresMetadata
record component
-
requiredStoredFields
Returns the value of therequiredStoredFields
record component.- Returns:
- the value of the
requiredStoredFields
record component
-