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

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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy