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
FieldsModifier and TypeFieldDescriptionstatic final StoredFieldsSpecUse when the source should be loaded but no other stored fields are requiredstatic final StoredFieldsSpecUse when no stored fields are required -
Constructor Summary
ConstructorsConstructorDescriptionStoredFieldsSpec(boolean requiresSource, boolean requiresMetadata, Set<String> requiredStoredFields) Creates an instance of aStoredFieldsSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> StoredFieldsSpecbuild(Collection<T> sources, Function<T, StoredFieldsSpec> converter) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.merge(StoredFieldsSpec other) Combine these stored field requirements with those from another StoredFieldsSpecbooleanReturns the value of therequiredStoredFieldsrecord component.booleanReturns the value of therequiresMetadatarecord component.booleanReturns the value of therequiresSourcerecord component.final StringtoString()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 aStoredFieldsSpecrecord class.- Parameters:
requiresSource- the value for therequiresSourcerecord componentrequiresMetadata- the value for therequiresMetadatarecord componentrequiredStoredFields- the value for therequiredStoredFieldsrecord 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 therequiresSourcerecord component.- Returns:
- the value of the
requiresSourcerecord component
-
requiresMetadata
public boolean requiresMetadata()Returns the value of therequiresMetadatarecord component.- Returns:
- the value of the
requiresMetadatarecord component
-
requiredStoredFields
Returns the value of therequiredStoredFieldsrecord component.- Returns:
- the value of the
requiredStoredFieldsrecord component
-