Package org.evrete

Class Configuration

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>, Copyable<Configuration>, FluentImports<Configuration>

public class Configuration extends Properties implements Copyable<Configuration>, FluentImports<Configuration>

Configuration class represents a configuration object that extends the Properties class and implements the Copyable and FluentImports interfaces.

Initial configuration is supplied to the KnowledgeService and then copied down to instances of Knowledge and RuleSession.

This way, changes in the configuration of a Knowledge instance will be passed down to every RuleSession spawned from that instance after the change. However, changes in the configuration of a RuleSession will only be available to that session.

See Also:
  • Field Details

  • Constructor Details

    • Configuration

      public Configuration(Properties defaults)
    • Configuration

      public Configuration()
  • Method Details

    • set

      public Configuration set(String key, String value)
    • setProperty

      public Object setProperty(String key, String value)
      Overrides:
      setProperty in class Properties
    • getAsBoolean

      public boolean getAsBoolean(String property)
      Retrieves the value of a property as a boolean.
      Parameters:
      property - the name of the property
      Returns:
      the value of the property as a boolean
    • getAsBoolean

      public boolean getAsBoolean(String property, boolean defaultValue)
      Retrieves the value of a property as a boolean. If the property is not found, it returns the default value provided.
      Parameters:
      property - the name of the property
      defaultValue - the default value to be returned if the property is not found
      Returns:
      the value of the property as a boolean, or the default value if the property is not found
    • getAsInteger

      public int getAsInteger(String property, int defaultValue)
    • getImports

      public Imports getImports()
      Description copied from interface: FluentImports
      Retrieves the current set of import statements.
      Specified by:
      getImports in interface FluentImports<Configuration>
      Returns:
      an Imports object containing the current set of import statements
    • addImport

      public final Configuration addImport(String imp)
      Description copied from interface: FluentImports
      Adds an import statement using its string representation.
      Specified by:
      addImport in interface FluentImports<Configuration>
      Parameters:
      imp - the full canonical name of the class or package to be imported
      Returns:
      this instance to allow for method chaining
    • copyOf

      public Configuration copyOf()
      Specified by:
      copyOf in interface Copyable<Configuration>