Class FactBuilder


  • public final class FactBuilder
    extends Object

    A fact declaration for RuleBuilder. Fact type can be specified both as a Java Class or as a type name.

    • Method Detail

      • fact

        public static FactBuilder fact​(String name,
                                       String type)

        'import static' this method for brevity of fact declarations.

        Parameters:
        name - fact type's reference variable
        type - fact's type name
        Returns:
        returns new FactBuilder
        Throws:
        NullPointerException - if any of the parameters is null
      • fact

        public static FactBuilder fact​(String name,
                                       Class<?> type)

        'import static' this method for brevity of fact declarations.

        Parameters:
        name - fact type's reference variable
        type - fact's Java class
        Returns:
        returns new FactBuilder
        Throws:
        NullPointerException - if any of the parameters is null
      • getName

        public String getName()

        The fact's variable name

        Returns:
        fact's variable name
      • getUnresolvedType

        public String getUnresolvedType()

        Returns fact's type as String

        Returns:
        fact's String type or null if the fact is declared as Java class.
      • getResolvedType

        public Class<?> getResolvedType()

        Returns fact's type as Java Class

        Returns:
        fact's declared Class or null if the fact's type is declared as named type.