Package org.elasticsearch.action.search
Record Class SearchShard
java.lang.Object
java.lang.Record
org.elasticsearch.action.search.SearchShard
- All Implemented Interfaces:
Comparable<SearchShard>
public record SearchShard(String clusterAlias, ShardId shardId)
extends Record
implements Comparable<SearchShard>
A class that encapsulates the
ShardId
and the cluster alias
of a shard used during the search action.-
Constructor Summary
ConstructorDescriptionSearchShard
(String clusterAlias, ShardId shardId) Creates an instance of aSearchShard
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclusterAlias
record component.int
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.shardId()
Returns the value of theshardId
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SearchShard
Creates an instance of aSearchShard
record class.- Parameters:
clusterAlias
- the value for theclusterAlias
record componentshardId
- the value for theshardId
record component
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SearchShard>
-
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)
. -
clusterAlias
Returns the value of theclusterAlias
record component.- Returns:
- the value of the
clusterAlias
record component
-
shardId
Returns the value of theshardId
record component.- Returns:
- the value of the
shardId
record component
-