All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nasa.pds.registry.common.connection.aws.MappingRespImpl Maven / Gradle / Ivy

package gov.nasa.pds.registry.common.connection.aws;

import java.util.HashSet;
import java.util.Set;
import org.opensearch.client.opensearch.indices.GetMappingResponse;
import org.opensearch.client.opensearch.indices.PutMappingResponse;
import org.opensearch.client.opensearch.indices.get_mapping.IndexMappingRecord;
import gov.nasa.pds.registry.common.Response;

class MappingRespImpl implements Response.Mapping {
  final Set fieldNames = new HashSet();
  MappingRespImpl (GetMappingResponse response) {
    for (IndexMappingRecord idx : response.result().values()) {
      this.fieldNames.addAll(idx.mappings().properties().keySet());
    }
  }
  MappingRespImpl (PutMappingResponse response) {}
  @Override
  public Set fieldNames() {
    return new HashSet(this.fieldNames); // make a copy so data is never corrupted
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy