Class Condition

Direct Known Subclasses:
AndCondition, OrCondition

public class Condition extends FragmentSequence
The class extends FragmentSequence and aims to add a new Clause or Condition to a Fragment.
  • Constructor Details

    • Condition

      public Condition(String prefix, String separator, String suffix)
      Creates a new Condition
      Parameters:
      prefix - The prefix
      separator - The separator
      suffix - The suffix
    • Condition

      public Condition(String separator)
      Creates a new Condition
      Parameters:
      separator - The separator
  • Method Details

    • addClause

      public Condition addClause(Criterion criterion, String field)
      Adds a Clause to a Fragment with a criterion that must be respected by a field given by input.
      Parameters:
      criterion - The criterion with which the Fragment is created.
      field - The name of the field that must comply with the pattern defined by the criterion, for matching the rule.
      Returns:
      A Fragment with a criterion that must be respected by a field given by input.
    • addClause

      public Condition addClause(String field)
      Adds a Clause to a Fragment for a specific field given by input.
      Parameters:
      field - The name of the field.
      Returns:
      A Fragment with Clause set for a specific field given by input.
    • addClauses

      public Condition addClauses(Criterion criterion, String... fieldRe)
      Adds a Clause to a Fragment with a criterion that must be respected by a field's array given by input.
      Parameters:
      criterion - The criterion with which the Fragment is created.
      fieldRe - The field's array that must comply with the pattern defined by the criterion, for matching the rule.
      Returns:
      A Fragment with a criterion that must be respected by a field's array given by input.
    • addClauses

      public Condition addClauses(String... fieldRe)
      Adds a Clause to a Fragment for a specific field's array given by input.
      Parameters:
      fieldRe - The field's array.
      Returns:
      A Fragment with Clause set for a specific field's array given by input.
    • addCondition

      public Condition addCondition(Condition c)
      Add a condition enclosed in round brackets.
      Parameters:
      c - The condition to add.
      Returns:
      A Fragment with Condition c, enclosed in round brackets.