Class Module


  • public final class Module
    extends java.lang.Object
    Represents a module in Fauna Query Language (FQL), which serves as a symbolic object with associated methods. Modules can represent built-in FQL objects, such as "Collection" or "Math", as well as custom entities like user-defined collections.

    For example, a specific collection named "MyCollection" can be represented as a Module in Java to enable document creation via the Fauna Java driver:

         var q = fql(
             "${coll}.create({foo:'bar'})",
             Map.of("coll", new Module("MyCollection"))
         );
    
         client.query(q);
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Module​(java.lang.String name)
      Constructs a new Module object with the specified name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Determines if this module is equal to another object.
      java.lang.String getName()
      Gets the name of this module as a string representation.
      int hashCode()
      Returns a hash code value for this module based on its name.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Module

        public Module​(java.lang.String name)
        Constructs a new Module object with the specified name.
        Parameters:
        name - The name of the module, representing either a built-in FQL object or a user-defined collection.
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets the name of this module as a string representation.
        Returns:
        A String representing the module's name.
      • equals

        public boolean equals​(java.lang.Object obj)
        Determines if this module is equal to another object. Two modules are considered equal if they have the same name.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The object to compare with this module for equality.
        Returns:
        true if the specified object is equal to this module; otherwise, false.
      • hashCode

        public int hashCode()
        Returns a hash code value for this module based on its name.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        An integer hash code for this module.