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 Details

    • SearchShard

      public SearchShard(@Nullable String clusterAlias, ShardId shardId)
      Creates an instance of a SearchShard record class.
      Parameters:
      clusterAlias - the value for the clusterAlias record component
      shardId - the value for the shardId record component
  • Method Details

    • compareTo

      public int compareTo(SearchShard o)
      Specified by:
      compareTo in interface Comparable<SearchShard>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • clusterAlias

      @Nullable public String clusterAlias()
      Returns the value of the clusterAlias record component.
      Returns:
      the value of the clusterAlias record component
    • shardId

      public ShardId shardId()
      Returns the value of the shardId record component.
      Returns:
      the value of the shardId record component