@@ -0,0 +1,1765 @@
+package com.google.fhirengine.index;%0A%0Aimport com.google.common.collect.HashMultimap;%0Aimport com.google.common.collect.ImmutableList;%0Aimport com.google.common.collect.ImmutableMultimap;%0Aimport com.google.common.collect.Multimap;%0A%0Aimport org.hl7.fhir.r4.model.ResourceType;%0Aimport org.hl7.fhir.r4.model.StringType;%0A%0Aimport java.lang.reflect.InvocationTargetException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport ca.uhn.fhir.model.api.annotation.SearchParamDefinition;%0A%0A/**%0A * Encapsulation of a FHIR resource (its resource type and ID) and all the indices that are%0A * extracted from the resource.%0A * %3Cp%3E%0A * For example, for a %7B@link org.hl7.fhir.r4.model.Patient%7D, this class should include the patient's%0A * resource type, ID, and all the field values of the patient that should be indexed such as name,%0A * email address.%0A */%0Apublic class ResourceIndices %7B%0A  /** The resource type. */%0A  private final ResourceType resourceType;%0A%0A  /** The ID of the resource. */%0A  private final String id;%0A%0A  /** Maps from the index definitions to the index values */%0A  private final List%3CStringIndex%3E stringIndices = new ArrayList%3C%3E();%0A%0A  public ResourceIndices(ResourceType resourceType, String id) %7B%0A    this.resourceType = resourceType;%0A    this.id = id;;%0A  %7D%0A%0A  /** Returns the %7B@link ResourceType%7D of the resource. */%0A  public ResourceType getResourceType()%7B%0A    return resourceType;%0A  %7D%0A%0A  /** Returns the ID of the resource. */%0A  public String getId() %7B%0A    return id;%0A  %7D%0A%0A  /** Adds string values to the index. */%0A  public void addStringIndex(StringIndex stringIndex) %7B%0A    stringIndices.add(stringIndex);%0A  %7D%0A%0A  /** Returns the string indices. */%0A  public ImmutableList%3CStringIndex%3E getStringIndices() %7B%0A    return ImmutableList.copyOf(stringIndices);%0A  %7D%0A%7D%0A

Create the ResourceIndices class that represents all the indices extracted for a given resource