nl.vpro.domain.api.AbstractSearch 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
/*
* Copyright (C) 2014 All rights reserved
* VPRO The Netherlands
*/
package nl.vpro.domain.api;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import nl.vpro.domain.api.media.MediaSearch;
import nl.vpro.domain.api.media.MemberRefSearch;
import nl.vpro.domain.api.page.AssociationSearch;
import nl.vpro.domain.api.page.PageSearch;
/**
* A Search interface but JAXB won't handle interfaces
*
* This is a {@link Matcher} that also has a method {@link #hasSearches}. So in other words the matching is
*
* @author Roelof Jan Koekoek
* @since 3.3
*/
@XmlAccessorType(XmlAccessType.NONE)
@XmlSeeAlso({MediaSearch.class, PageSearch.class, MemberRefSearch.class, AssociationSearch.class})
@XmlTransient
public abstract class AbstractSearch extends AbstractMatcher {
public abstract boolean hasSearches();
protected AbstractSearch() {
}
protected AbstractSearch(Match match) {
super(match);
}
protected static boolean atLeastOneHasSearches(Iterable>... collections) {
for (Iterable> col : collections) {
if (col != null) {
if (col instanceof MatcherList, ?>) {
if (!((MatcherList) col).isEmpty()) {
return true;
}
} else {
if (col.iterator().hasNext()) {
return true;
}
}
}
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy