com.merkle.oss.magnolia.powernode.predicate.IsNamePrefix Maven / Gradle / Ivy
package com.merkle.oss.magnolia.powernode.predicate;
import com.merkle.oss.magnolia.powernode.RepositoryExceptionDelegator;
import javax.jcr.Node;
import java.util.function.Predicate;
public class IsNamePrefix extends RepositoryExceptionDelegator implements Predicate {
private final String namePrefix;
public IsNamePrefix(final String namePrefix) {
this.namePrefix = namePrefix;
}
@Override
public boolean test(final N node) {
return getOrThrow(node::getName).startsWith(namePrefix);
}
}