Class FactPattern


  • public class FactPattern
    extends java.lang.Object
    Represents a pattern to match facts stored in Oso Cloud.

    Allows using concrete values (Value), type wildcards (ValueOfType), or complete wildcards (ValuePattern.ANY) for arguments.

    • Constructor Summary

      Constructors 
      Constructor Description
      FactPattern​(java.lang.String predicate, ValuePattern... args)
      Creates a fact pattern with a specific predicate.
      FactPattern​(java.lang.String predicate, java.util.List<ValuePattern> args)
      Creates a fact pattern with a specific predicate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • predicate

        public final java.lang.String predicate
    • Constructor Detail

      • FactPattern

        public FactPattern​(java.lang.String predicate,
                           ValuePattern... args)
        Creates a fact pattern with a specific predicate.
        Parameters:
        predicate - The predicate of the fact to match. Must not be null.
        args - The arguments to match. Can contain Value, ValueOfType, or ValuePattern.ANY.
        Throws:
        java.lang.IllegalArgumentException - if predicate is null or any arg is null.
      • FactPattern

        public FactPattern​(java.lang.String predicate,
                           java.util.List<ValuePattern> args)
        Creates a fact pattern with a specific predicate.
        Parameters:
        predicate - The predicate of the fact to match. Must not be null.
        args - The arguments to match as a List. Can contain Value, ValueOfType, or ValuePattern.ANY.
        Throws:
        java.lang.IllegalArgumentException - if predicate is null or any arg is null.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object