Class StringSearcher

java.lang.Object
com.blamejared.searchables.lang.StringSearcher

public class StringSearcher extends Object
  • Constructor Details

    • StringSearcher

      public StringSearcher()
  • Method Details

    • search

      public static <T> Optional<T> search(String search, Visitor<T> visitor)
      Parses the string and visits the given visitor.
      Parameters:
      search - The string to search.
      visitor - The visitor to visit.
      Returns:
      The optional result of the visitor.
    • search

      public static <T, C> Optional<T> search(String search, ContextAwareVisitor<T,C> visitor, C context)
      Parses the string and visits the given visitor with context.
      Parameters:
      search - The string to search.
      visitor - The visitor to visit.
      context - The extra context for the visitor.
      Returns:
      The optional result of the visitor.
    • expression

      public static Optional<Expression> expression(String search)
      Parses the string and returns and optional Expression
      Parameters:
      search - The string to search.
      Returns:
      The string as an optional Expression