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

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

Go to download

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

The newest version!
/*
 * Copyright (C) 2014 Licensed under the Apache License, Version 2.0
 * VPRO The Netherlands
 */
package nl.vpro.domain.api.media;

import jakarta.validation.Valid;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

import nl.vpro.domain.api.FacetOrder;
import nl.vpro.domain.api.SearchableLimitableFacet;
import nl.vpro.domain.api.TermSearch;

/**
 * @author Roelof Jan Koekoek
 * @since 3.3
 */
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "mediaSearchableTermFacetType")
public class MediaSearchableTermFacet extends MediaFacet implements SearchableLimitableFacet {

    @Valid
    TermSearch subSearch;

    public MediaSearchableTermFacet() {
    }

    public MediaSearchableTermFacet(Integer threshold, FacetOrder sort, Integer max) {
        super(threshold, sort, max);
    }
    @lombok.Builder(builderMethodName = "searchableBuilder")
    private MediaSearchableTermFacet(Integer threshold, FacetOrder sort, Integer max, TermSearch termSearch) {
        super(threshold, sort, max);
        this.subSearch = termSearch;
    }

    @Override
    public boolean hasSubSearch() {
        return subSearch != null && subSearch.hasSearches();
    }

    @Override
    @XmlElement
    public TermSearch getSubSearch() {
        return subSearch;
    }

    @Override
    public void setSubSearch(TermSearch subSearch) {
        this.subSearch = subSearch;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy