Class FaunaTemplate

  • All Implemented Interfaces:
    java.lang.Iterable<FaunaTemplate.TemplatePart>

    public final class FaunaTemplate
    extends java.lang.Object
    implements java.lang.Iterable<FaunaTemplate.TemplatePart>
    Represents a template for constructing Fauna queries with placeholders for variable interpolation. This template uses a dollar-sign ($) syntax for identifying variable placeholders.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FaunaTemplate.TemplatePart
      Represents a part of the template, which can either be a literal string or a variable placeholder.
    • Constructor Summary

      Constructors 
      Constructor Description
      FaunaTemplate​(java.lang.String template)
      Constructs a new FaunaTemplate with the specified template string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<FaunaTemplate.TemplatePart> iterator()
      Creates an iterator over the parts of the template, distinguishing between literal text and variable placeholders.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • FaunaTemplate

        public FaunaTemplate​(java.lang.String template)
        Constructs a new FaunaTemplate with the specified template string. The template may contain literals and variable placeholders identified by a dollar sign and an optional set of braces (e.g., ${variable}).
        Parameters:
        template - the string template containing literals and placeholders.
    • Method Detail

      • iterator

        public java.util.Iterator<FaunaTemplate.TemplatePart> iterator()
        Creates an iterator over the parts of the template, distinguishing between literal text and variable placeholders.
        Specified by:
        iterator in interface java.lang.Iterable<FaunaTemplate.TemplatePart>
        Returns:
        an Iterator that iterates over the template parts.