Record Class SearchMatches

java.lang.Object
java.lang.Record
io.meeds.social.search.model.SearchMatches
Record Components:
ids - the matching object ids, as the host's search index knows them, best first
matches - what matched, per object id; an object may have none

public record SearchMatches(List<String> ids, Map<String, SearchFieldMatches> matches) extends Record
What a search contributor answers, and what io.meeds.social.search.service.SearchMatchService#collect returns to the host once every contributor's answer is merged.
Since:
8.0
  • Field Details

    • EMPTY

      public static final SearchMatches EMPTY
      The answer of a contributor that found nothing or could not search.
  • Constructor Details

    • SearchMatches

      public SearchMatches(List<String> ids, Map<String, SearchFieldMatches> matches)
      Creates an instance of a SearchMatches record class.
      Parameters:
      ids - the value for the ids record component
      matches - the value for the matches record component
  • Method Details

    • 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.
    • ids

      public List<String> ids()
      Returns the value of the ids record component.
      Returns:
      the value of the ids record component
    • matches

      public Map<String, SearchFieldMatches> matches()
      Returns the value of the matches record component.
      Returns:
      the value of the matches record component