Interface FluentImports<T>

Type Parameters:
T - the type of the implementing class to allow method chaining
All Known Subinterfaces:
Knowledge, RuleSession<S>, RuleSetContext<C,R>, RuntimeContext<C>, StatefulSession, StatelessSession
All Known Implementing Classes:
AbstractSessionWrapper, Configuration, KnowledgeWrapper

public interface FluentImports<T>
Represents an entity capable of managing Java imports in a fluent manner. Allows for adding import statements using both string representations and Class objects. Additionally, it provides methods to retrieve the currently added import statements.
  • Method Details

    • addImport

      T addImport(String imp)
      Adds an import statement using its string representation.
      Parameters:
      imp - the full canonical name of the class or package to be imported
      Returns:
      this instance to allow for method chaining
    • addImport

      default T addImport(Class<?> type)
      Adds an explicit type import.
      Parameters:
      type - the class to be imported
      Returns:
      an instance of the implementing class to allow for method chaining
      Throws:
      IllegalArgumentException - if the canonical name of the class is null
    • getImports

      Imports getImports()
      Retrieves the current set of import statements.
      Returns:
      an Imports object containing the current set of import statements
    • getJavaImports

      @Deprecated default Set<String> getJavaImports()
      Deprecated.
      Retrieves a set containing the string representations of Java import statements.
      Returns:
      a Set of strings representing the current Java import statements