Class StartsWithPredicateGenerator

java.lang.Object
nl.datasteel.crudcraft.codegen.writer.search.AbstractPredicateGenerator
nl.datasteel.crudcraft.codegen.writer.search.StartsWithPredicateGenerator
All Implemented Interfaces:
PredicateGenerator

public class StartsWithPredicateGenerator extends AbstractPredicateGenerator implements PredicateGenerator
Generates a predicate for checking if a string field starts with a given value. This is used in search requests to filter results based on the starting characters of a string property.
  • Constructor Details

    • StartsWithPredicateGenerator

      public StartsWithPredicateGenerator()
  • Method Details

    • generate

      public com.squareup.javapoet.CodeBlock generate(SearchField f)
      Generates a CodeBlock that checks if the search request's property starts with a specified value.
      Specified by:
      generate in interface PredicateGenerator
      Parameters:
      f - the search field containing the property and operator information
      Returns:
      a CodeBlock representing the predicate logic for the starts with condition