001package org.gbif.api.model.collections.search; 002 003import java.util.ArrayList; 004import java.util.List; 005import lombok.Data; 006import lombok.NoArgsConstructor; 007import org.gbif.api.model.common.paging.Pageable; 008import org.gbif.api.model.common.paging.PagingResponse; 009import org.gbif.api.vocabulary.collections.CollectionsFacetParameter; 010 011@Data 012@NoArgsConstructor 013public class FacetedSearchResponse<T, F extends CollectionsFacetParameter> 014 extends PagingResponse<T> { 015 016 private List<CollectionFacet<F>> facets = new ArrayList<>(); 017 018 public FacetedSearchResponse( 019 Pageable page, Long count, List<T> results, List<CollectionFacet<F>> facets) { 020 super(page, count, results); 021 this.facets = facets; 022 } 023 024 public FacetedSearchResponse(Pageable page, Long count, List<T> results) { 025 this(page, count, results, new ArrayList<>()); 026 } 027 028 public FacetedSearchResponse( 029 long offset, int limit, Long count, List<T> results, List<CollectionFacet<F>> facets) { 030 super(offset, limit, count, results); 031 this.facets = new ArrayList<>(); 032 } 033 034 public FacetedSearchResponse(long offset, int limit, Long count, List<T> results) { 035 this(offset, limit, count, results, new ArrayList<>()); 036 } 037}