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

nl.vpro.domain.api.media.MediaSearchResult Maven / Gradle / Ivy

Go to download

Contains the objects used by the Frontend API, like forms and result objects

There is a newer version: 8.3.3
Show newest version
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 sr) {
        super(sr);
    }

    public MediaSearchResult(GenericMediaSearchResult sr, TotalQualifier totalQualifier) {
        super(sr);
        setFacets(sr.getFacets());
        setSelectedFacets(sr.getSelectedFacets());
        this.totalQualifier = totalQualifier;
    }
    public MediaSearchResult(GenericMediaSearchResult sr) {
        this(sr, sr.getTotalQualifier());
    }


    @Override
    public MediaResult asResult() {
        return new MediaResult(super.asResult());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy