Beast is an easy to use Key/Value storage manager using Google's Gson serializer.
Create a new instance of Beast and give it a StoragType
Beast b = new Beast(new StoreToFile( CacheType,File));
NO_CACHE: Never caches CACHE_ON_START: Caches every stored Data on start CACHE: Caches reuested values only
BeastItem bi = b.get(id);
If storeId does not exist, Beast add it using the default StorageType.
bi.set(object);
Object value = bi.get();
List<Object> arrayList = bi.getList();
You can move a Value from a StorageType to an other
bi.move(storageId);
bi.remove();
b.addStorageType("storageId",StorageType);
BeastItem bi = b.create(id,storageTypeid)
Just extend the abstract StorageType class and call
super.loadCache();
at the end of your constructor;
Just implement the Serializer interface
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.Jonbeckas:Beast:version'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Jonbeckas</groupId>
<artifactId>Beast</artifactId>
<version>Version</version>
</dependency>
https://github.com/google/gson
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.