org.hibernate.search.engine.spi.ContainedInRecursionContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-search-engine Show documentation
Show all versions of hibernate-search-engine Show documentation
Core of the Object/Lucene mapper, query engine and index management
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.search.engine.spi;
import java.util.Set;
/**
* Used to check the constraints of depth when using {@link org.hibernate.search.annotations.IndexedEmbedded}
* or {@link org.hibernate.search.annotations.ContainedIn} annotations.
*
* @author Davide D'Alto
* @author Yoann Rodiere
*/
public class ContainedInRecursionContext {
private final int maxDepth;
private final int depth;
private final Set comprehensivePaths;
public ContainedInRecursionContext(int maxDepth, int depth, Set comprehensivePaths) {
this.maxDepth = maxDepth;
this.depth = depth;
this.comprehensivePaths = comprehensivePaths;
}
public int getMaxDepth() {
return maxDepth;
}
public int getDepth() {
return depth;
}
public Set getComprehensivePaths() {
return comprehensivePaths;
}
public boolean isTerminal() {
return depth > maxDepth || comprehensivePaths != null && comprehensivePaths.isEmpty();
}
@Override
public String toString() {
return "[maxDepth=" + maxDepth + ", level=" + depth + ", comprehensivePaths=" + comprehensivePaths + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy