Class TypePredicate
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate
-
- All Implemented Interfaces:
Predicate<org.apache.jackrabbit.oak.spi.state.NodeState>
,java.util.function.Predicate<org.apache.jackrabbit.oak.spi.state.NodeState>
public class TypePredicate extends java.lang.Object implements java.util.function.Predicate<org.apache.jackrabbit.oak.spi.state.NodeState>, Predicate<org.apache.jackrabbit.oak.spi.state.NodeState>
Inheritance-aware node type predicate fornode states
.- Since:
- Oak 0.11
-
-
Constructor Summary
Constructors Constructor Description TypePredicate(@NotNull org.apache.jackrabbit.oak.spi.state.NodeState root, @NotNull java.lang.Iterable<java.lang.String> names)
Creates a predicate for checking whether a node state is an instance of any of the named node types.TypePredicate(@NotNull org.apache.jackrabbit.oak.spi.state.NodeState root, @NotNull java.lang.String name)
Creates a predicate for checking whether a node state is an instance of the named node type.TypePredicate(@NotNull org.apache.jackrabbit.oak.spi.state.NodeState root, @NotNull java.lang.String[] names)
Creates a predicate for checking whether a node state is an instance of any of the named node types.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
apply(@Nullable org.apache.jackrabbit.oak.api.Tree input)
Deprecated, for removal: This API element is subject to removal in a future version.usetest(Tree)
instead (see OAK-8874)boolean
apply(@Nullable org.apache.jackrabbit.oak.spi.state.NodeState input)
Deprecated, for removal: This API element is subject to removal in a future version.usetest(NodeState)
instead (see OAK-8874)boolean
apply(java.lang.String primary, java.util.Set<java.lang.String> mixins)
Deprecated, for removal: This API element is subject to removal in a future version.usetest(String, Set)
instead (see OAK-8874)static @NotNull TypePredicate
isOrderable(@NotNull org.apache.jackrabbit.oak.spi.state.NodeState root)
boolean
test(@Nullable org.apache.jackrabbit.oak.api.Tree input)
boolean
test(@Nullable org.apache.jackrabbit.oak.spi.state.NodeState input)
boolean
test(java.lang.String primary, java.util.Set<java.lang.String> mixins)
java.lang.String
toString()
-
-
-
Constructor Detail
-
TypePredicate
public TypePredicate(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeState root, @NotNull @NotNull java.lang.String name)
Creates a predicate for checking whether a node state is an instance of the named node type. This is an O(1) operation in terms of item accesses.- Parameters:
root
- root node statename
- Oak name of the node type to check for
-
TypePredicate
public TypePredicate(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeState root, @NotNull @NotNull java.lang.Iterable<java.lang.String> names)
Creates a predicate for checking whether a node state is an instance of any of the named node types. This is an O(n) operation in terms of item accesses, with n being the number of given node types.- Parameters:
root
- root node statenames
- Oak names of the node types to check for
-
TypePredicate
public TypePredicate(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeState root, @NotNull @NotNull java.lang.String[] names)
Creates a predicate for checking whether a node state is an instance of any of the named node types. This is an O(n) operation in terms of item accesses, with n being the number of given node types.- Parameters:
root
- root node statenames
- Oak names of the node types to check for
-
-
Method Detail
-
isOrderable
@NotNull public static @NotNull TypePredicate isOrderable(@NotNull @NotNull org.apache.jackrabbit.oak.spi.state.NodeState root)
-
test
public boolean test(java.lang.String primary, java.util.Set<java.lang.String> mixins)
-
test
public boolean test(@Nullable @Nullable org.apache.jackrabbit.oak.api.Tree input)
-
test
public boolean test(@Nullable @Nullable org.apache.jackrabbit.oak.spi.state.NodeState input)
- Specified by:
test
in interfacejava.util.function.Predicate<org.apache.jackrabbit.oak.spi.state.NodeState>
-
apply
@Deprecated(since="1.26.0", forRemoval=true) public boolean apply(@Nullable @Nullable org.apache.jackrabbit.oak.spi.state.NodeState input)
Deprecated, for removal: This API element is subject to removal in a future version.usetest(NodeState)
instead (see OAK-8874)
-
apply
@Deprecated(since="1.26.0", forRemoval=true) public boolean apply(@Nullable @Nullable org.apache.jackrabbit.oak.api.Tree input)
Deprecated, for removal: This API element is subject to removal in a future version.usetest(Tree)
instead (see OAK-8874)
-
apply
@Deprecated(since="1.26.0", forRemoval=true) public boolean apply(java.lang.String primary, java.util.Set<java.lang.String> mixins)
Deprecated, for removal: This API element is subject to removal in a future version.usetest(String, Set)
instead (see OAK-8874)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-