Package com.fauna.types
Class Module
- java.lang.Object
-
- com.fauna.types.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 newModule
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.
-
-
-
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 classjava.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 classjava.lang.Object
- Returns:
- An integer hash code for this module.
-
-