Class Conditions


  • @API(status=STABLE,
         since="1.0")
    public final class Conditions
    extends Object
    Builder for various conditions.
    Since:
    1.0
    Author:
    Michael J. Simons, Gerrit Meier, Aakash Sorathiya
    • Method Detail

      • not

        @NotNull
        @Contract(pure=true)
        public static @NotNull Condition not​(@NotNull
                                             @NotNull Condition condition)
        Negates the given condition.
        Parameters:
        condition - The condition to negate. Must not be null.
        Returns:
        The negated condition.
      • not

        @NotNull
        @Contract(pure=true)
        public static @NotNull Condition not​(@NotNull
                                             @NotNull RelationshipPattern pattern)
        Negates the given pattern element: The pattern must not matched to be included in the result.
        Parameters:
        pattern - The pattern to negate. Must not be null.
        Returns:
        A condition that evaluates to true when the pattern does not match.
      • noCondition

        @NotNull
        @Contract(pure=true)
        public static @NotNull Condition noCondition()
        Creates a placeholder condition which is not rendered in the final statement but is useful while chaining conditions together.
        Returns:
        A placeholder condition.
      • isTrue

        public static Condition isTrue()
        Returns:
        a condition that is always true.
      • isFalse

        public static Condition isFalse()
        Returns:
        a condition that is always false.
      • hasLabelsOrType

        public static Condition hasLabelsOrType​(SymbolicName symbolicName,
                                                String... labelsOrTypes)
        Parameters:
        symbolicName - Reference to the entity that should be checked for labels or types
        labelsOrTypes - the list of labels or types to check for
        Returns:
        A condition that checks whether a node has a set of given labels or a relationship a set of given types.
        Since:
        2021.3.0