Class MongoPipeline

java.lang.Object
com.barden.library.database.mongo.pipeline.MongoPipeline

public final class MongoPipeline extends Object
Mongo pipeline.
  • Constructor Details

    • MongoPipeline

      public MongoPipeline(@Nonnull String database, @Nonnull String collection, @Nonnull String key, @Nonnull Object value)
      Creates Mongo pipeline object.
      Parameters:
      database - Database.
      collection - Collection.
      key - Key.
      value - Value.
  • Method Details

    • getUID

      @Nonnull public UUID getUID()
      Gets UID.
      Returns:
      UID.
    • getDatabase

      @Nonnull public String getDatabase()
      Gets database.
      Returns:
      Database.
    • getCollection

      @Nonnull public String getCollection()
      Gets collection.
      Returns:
      Collection.
    • getKey

      @Nonnull public String getKey()
      Gets key.
      Returns:
      Key.
    • getValue

      @Nonnull public Object getValue()
      Gets value.
      Returns:
      Value.
    • getDocument

      @Nonnull public org.bson.Document getDocument()
      Gets document.
      Returns:
      Document.
    • getPaths

      @Nonnull public HashMap<Object,String> getPaths()
      Gets paths.
      Returns:
      Paths.
    • getPath

      @Nonnull public String getPath(@Nonnull Object key)
      Gets path.
      Parameters:
      key - Key.
      Returns:
      Path value.
    • setPath

      @Nonnull public MongoPipeline setPath(@Nonnull Object key, @Nonnull String value)
      Gets path.
      Parameters:
      key - Key.
      value - Path value.
      Returns:
      Mongo pipeline builder.
    • getConsumers

      @Nonnull public HashMap<Object,Consumer<MongoPipeline.Index>> getConsumers()
      Gets consumers.
      Returns:
      Consumers.
    • getConsumer

      @Nonnull public Consumer<MongoPipeline.Index> getConsumer(@Nonnull Object key)
      Gets consumer.
      Parameters:
      key - Key.
      Returns:
      Consumer.
    • setConsumer

      @Nonnull public MongoPipeline setConsumer(@Nonnull Object key, @Nonnull Consumer<MongoPipeline.Index> consumer)
      Sets consumer.
      Parameters:
      key - Key.
      consumer - Consumer.
      Returns:
      Mongo pipeline builder.
    • configure

      @Nonnull public MongoPipeline configure(@Nonnull Object key, String path, @Nonnull Consumer<MongoPipeline.Index> consumer)
      Configure pipeline index.
      Parameters:
      key - Key.
      path - Path.
      consumer - Consumer.
      Returns:
      Mongo pipeline builder.
    • createExecutor

      @Nonnull public MongoPipelineExecutor createExecutor()
      Creates new pipeline executor object.
      Returns:
      Mongo Pipeline Executor.