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

com.enonic.xp.xml.NodeNamePredicate Maven / Gradle / Ivy

The newest version!
package com.enonic.xp.xml;

import java.util.Set;
import java.util.function.Predicate;

import org.w3c.dom.Node;

final class NodeNamePredicate
    implements Predicate
{
    private final Set set;

    NodeNamePredicate( final String... names )
    {
        this.set = Set.of(names);
    }

    @Override
    public boolean test( final Node node )
    {
        return ( this.set.contains( node.getNodeName() ) || this.set.contains( node.getLocalName() ) );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy