Class WrapperDatabase

  • All Implemented Interfaces:
    de.dytanic.cloudnet.common.INameable, de.dytanic.cloudnet.driver.database.Database, IDatabase, java.lang.AutoCloseable

    public class WrapperDatabase
    extends java.lang.Object
    implements IDatabase
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> clearAsync()  
      void close()  
      boolean contains​(java.lang.String key)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> containsAsync​(java.lang.String key)  
      boolean delete​(java.lang.String key)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deleteAsync​(java.lang.String key)  
      java.util.Collection<de.dytanic.cloudnet.common.document.gson.JsonDocument> documents()  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.common.document.gson.JsonDocument>> documentsAsync()  
      java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> entries()  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument>> entriesAsync()  
      java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> filter​(java.util.function.BiPredicate<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> predicate)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument>> filterAsync​(java.util.function.BiPredicate<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> predicate)  
      java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument> get​(de.dytanic.cloudnet.common.document.gson.JsonDocument filters)  
      de.dytanic.cloudnet.common.document.gson.JsonDocument get​(java.lang.String key)  
      java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument> get​(java.lang.String fieldName, java.lang.Object fieldValue)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument>> getAsync​(de.dytanic.cloudnet.common.document.gson.JsonDocument filters)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<de.dytanic.cloudnet.common.document.gson.JsonDocument> getAsync​(java.lang.String key)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument>> getAsync​(java.lang.String fieldName, java.lang.Object fieldValue)  
      long getDocumentsCount()  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Long> getDocumentsCountAsync()  
      java.lang.String getName()  
      boolean insert​(java.lang.String key, de.dytanic.cloudnet.common.document.gson.JsonDocument document)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> insertAsync​(java.lang.String key, de.dytanic.cloudnet.common.document.gson.JsonDocument document)  
      boolean isSynced()  
      void iterate​(java.util.function.BiConsumer<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> consumer)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> iterateAsync​(java.util.function.BiConsumer<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> consumer)  
      java.util.Collection<java.lang.String> keys()  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<java.lang.String>> keysAsync()  
      boolean update​(java.lang.String key, de.dytanic.cloudnet.common.document.gson.JsonDocument document)  
      @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> updateAsync​(java.lang.String key, de.dytanic.cloudnet.common.document.gson.JsonDocument document)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface de.dytanic.cloudnet.common.INameable
      • insert

        public boolean insert​(java.lang.String key,
                              de.dytanic.cloudnet.common.document.gson.JsonDocument document)
        Specified by:
        insert in interface de.dytanic.cloudnet.driver.database.Database
      • update

        public boolean update​(java.lang.String key,
                              de.dytanic.cloudnet.common.document.gson.JsonDocument document)
        Specified by:
        update in interface de.dytanic.cloudnet.driver.database.Database
      • contains

        public boolean contains​(java.lang.String key)
        Specified by:
        contains in interface de.dytanic.cloudnet.driver.database.Database
      • delete

        public boolean delete​(java.lang.String key)
        Specified by:
        delete in interface de.dytanic.cloudnet.driver.database.Database
      • get

        public de.dytanic.cloudnet.common.document.gson.JsonDocument get​(java.lang.String key)
        Specified by:
        get in interface de.dytanic.cloudnet.driver.database.Database
      • get

        public java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument> get​(java.lang.String fieldName,
                                                                                         java.lang.Object fieldValue)
        Specified by:
        get in interface de.dytanic.cloudnet.driver.database.Database
      • get

        public java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument> get​(de.dytanic.cloudnet.common.document.gson.JsonDocument filters)
        Specified by:
        get in interface de.dytanic.cloudnet.driver.database.Database
      • keys

        public java.util.Collection<java.lang.String> keys()
        Specified by:
        keys in interface de.dytanic.cloudnet.driver.database.Database
      • documents

        public java.util.Collection<de.dytanic.cloudnet.common.document.gson.JsonDocument> documents()
        Specified by:
        documents in interface de.dytanic.cloudnet.driver.database.Database
      • entries

        public java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> entries()
        Specified by:
        entries in interface de.dytanic.cloudnet.driver.database.Database
      • filter

        public java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> filter​(java.util.function.BiPredicate<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> predicate)
        Specified by:
        filter in interface de.dytanic.cloudnet.driver.database.Database
      • iterate

        public void iterate​(java.util.function.BiConsumer<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> consumer)
        Specified by:
        iterate in interface de.dytanic.cloudnet.driver.database.Database
      • clear

        public void clear()
        Specified by:
        clear in interface de.dytanic.cloudnet.driver.database.Database
      • getDocumentsCount

        public long getDocumentsCount()
        Specified by:
        getDocumentsCount in interface de.dytanic.cloudnet.driver.database.Database
      • isSynced

        public boolean isSynced()
        Specified by:
        isSynced in interface de.dytanic.cloudnet.driver.database.Database
      • insertAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> insertAsync​(java.lang.String key,
                                                                                                   de.dytanic.cloudnet.common.document.gson.JsonDocument document)
        Specified by:
        insertAsync in interface de.dytanic.cloudnet.driver.database.Database
      • containsAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> containsAsync​(java.lang.String key)
        Specified by:
        containsAsync in interface de.dytanic.cloudnet.driver.database.Database
      • updateAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> updateAsync​(java.lang.String key,
                                                                                                   de.dytanic.cloudnet.common.document.gson.JsonDocument document)
        Specified by:
        updateAsync in interface de.dytanic.cloudnet.driver.database.Database
      • deleteAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> deleteAsync​(java.lang.String key)
        Specified by:
        deleteAsync in interface de.dytanic.cloudnet.driver.database.Database
      • getAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<de.dytanic.cloudnet.common.document.gson.JsonDocument> getAsync​(java.lang.String key)
        Specified by:
        getAsync in interface de.dytanic.cloudnet.driver.database.Database
      • getAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument>> getAsync​(java.lang.String fieldName,
                                                                                                                                                    java.lang.Object fieldValue)
        Specified by:
        getAsync in interface de.dytanic.cloudnet.driver.database.Database
      • getAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.List<de.dytanic.cloudnet.common.document.gson.JsonDocument>> getAsync​(de.dytanic.cloudnet.common.document.gson.JsonDocument filters)
        Specified by:
        getAsync in interface de.dytanic.cloudnet.driver.database.Database
      • keysAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<java.lang.String>> keysAsync()
        Specified by:
        keysAsync in interface de.dytanic.cloudnet.driver.database.Database
      • documentsAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<de.dytanic.cloudnet.common.document.gson.JsonDocument>> documentsAsync()
        Specified by:
        documentsAsync in interface de.dytanic.cloudnet.driver.database.Database
      • entriesAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument>> entriesAsync()
        Specified by:
        entriesAsync in interface de.dytanic.cloudnet.driver.database.Database
      • filterAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Map<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument>> filterAsync​(java.util.function.BiPredicate<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> predicate)
        Specified by:
        filterAsync in interface de.dytanic.cloudnet.driver.database.Database
      • iterateAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> iterateAsync​(java.util.function.BiConsumer<java.lang.String,​de.dytanic.cloudnet.common.document.gson.JsonDocument> consumer)
        Specified by:
        iterateAsync in interface de.dytanic.cloudnet.driver.database.Database
      • clearAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> clearAsync()
        Specified by:
        clearAsync in interface de.dytanic.cloudnet.driver.database.Database
      • getDocumentsCountAsync

        @NotNull
        public @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Long> getDocumentsCountAsync()
        Specified by:
        getDocumentsCountAsync in interface de.dytanic.cloudnet.driver.database.Database
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable