com.ingensi.data:storeit-core

Light package used to store entities to various storage

Лицензия

Лицензия

Категории

Категории

Данные
Группа

Группа

com.ingensi.data
Идентификатор

Идентификатор

storeit-core
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Light package used to store entities to various storage

Скачать storeit-core

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.ingensi.data/storeit-core/ -->
<dependency>
    <groupId>com.ingensi.data</groupId>
    <artifactId>storeit-core</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.ingensi.data/storeit-core/
implementation 'com.ingensi.data:storeit-core:1.0.2'
// https://jarcasting.com/artifacts/com.ingensi.data/storeit-core/
implementation ("com.ingensi.data:storeit-core:1.0.2")
'com.ingensi.data:storeit-core:jar:1.0.2'
<dependency org="com.ingensi.data" name="storeit-core" rev="1.0.2">
  <artifact name="storeit-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ingensi.data', module='storeit-core', version='1.0.2')
)
libraryDependencies += "com.ingensi.data" % "storeit-core" % "1.0.2"
[com.ingensi.data/storeit-core "1.0.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

StoreIt

Light Java library used to store entities to various storage.

How to use!

StoreIt provides an abstraction layer to store, get, list, update and delete all kind of entities.

To allow an entity to be stored into a StoreIt storage, it has to implement StoredEntity interface, to provides a getId() method.

Build with maven

Form the root package, install StoredIt locally:

mvn install

Add dependency in your project

Add dependency in your pom.xml according to the storage your want to use:

<dependency>
    <groupId>com.ingensi.data</groupId>
    <artifactId>storeit-elasticsearch</artifactId>
    <version>${storeit.version}</version>
</dependency>

Store your first entities

To store an entity with StoreIt, you need a StoredEntity class. Here is an example with a User class:

public class User implements StoredEntity {
    private final String username;
    private final String firstname;
    private final String lastname;
    
    public User(String username, String firstname, String lastname) {
        this.username = username;
        this.firstname = firstname;
        this.lastname = lastname;
    }
    
    public String getUsername() {
        return username;
    }
    
    public String getFirstname() {
        return firstname;
    }
    
    public String getLastname() {
        return lastname;
    }
    
    @Override
    public String getId() {
        return username;
    }
}

Then you are able to create, get, list, update or delete User into various storage by instantiating a Storage<User>:

Storage<User> storage = new xxxStorage<>(
    // DEPENDS ON THE STORAGE IMPLEMENTATION
);

// store new user
storage.store(new User("fbar", "foo", "bar"));
// list all users
Collection<User> users = storage.list();
// update user
storage.store(new User("fbar", "Jason", "Wilson"));
// get specific user
User bob = storage.get("bob");
// delete a user
storage.delete("fbar");

Structure and implementations

Each implemented module contains its own specific documentation.

Implement your own Storage

Look at existing implementations to learn how to implement your own Storage. Don't forget to contribute :)

com.ingensi.data

Ingensi

Ingensi Labs, Cyrès group

Версии библиотеки

Версия
1.0.2