nl.vpro.domain.api.media.MediaSearchResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-domain Show documentation
Show all versions of api-domain Show documentation
Contains the objects used by the Frontend API, like forms and result objects
package nl.vpro.domain.api.media;
import java.util.Collections;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import nl.vpro.domain.api.GenericMediaSearchResult;
import nl.vpro.domain.api.SearchResult;
import nl.vpro.domain.api.SearchResultItem;
import nl.vpro.domain.media.MediaObject;
/**
* Exists only because of https://jira.vpro.nl/browse/API-118
*
* @author Michiel Meeuwissen
* @since 2.0
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "mediaSearchResult")
@XmlType(name = "mediaSearchResultType")
public class MediaSearchResult extends GenericMediaSearchResult {
public MediaSearchResult() {
}
public static MediaSearchResult emptyResult(Long offset, Integer max) {
return new MediaSearchResult(Collections.emptyList(), offset, max, Total.EMPTY);
}
public MediaSearchResult(List> list, Long offset, Integer max, Total total) {
super(list, offset, max, total);
}
public MediaSearchResult(List> list, MediaFacetsResult facetsResult, Long offset, Integer max, Total total) {
super(list, facetsResult, offset, max, total);
}
public MediaSearchResult(SearchResult extends MediaObject> sr) {
super(sr);
}
public MediaSearchResult(GenericMediaSearchResult extends MediaObject> sr, TotalQualifier totalQualifier) {
super(sr);
setFacets(sr.getFacets());
setSelectedFacets(sr.getSelectedFacets());
this.totalQualifier = totalQualifier;
}
public MediaSearchResult(GenericMediaSearchResult extends MediaObject> sr) {
this(sr, sr.getTotalQualifier());
}
@Override
public MediaResult asResult() {
return new MediaResult(super.asResult());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy