2021-01-31 00:36:21 +01:00
|
|
|
package it.cavallium.dbengine.database.collections;
|
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
import it.cavallium.dbengine.buffers.Buf;
|
2021-01-31 00:36:21 +01:00
|
|
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
|
|
|
import it.cavallium.dbengine.database.LLDictionary;
|
2021-02-02 19:40:37 +01:00
|
|
|
import it.cavallium.dbengine.database.serialization.Serializer;
|
2021-01-31 00:36:21 +01:00
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
2021-01-31 19:52:47 +01:00
|
|
|
public class SubStageGetterSingle<T> implements SubStageGetter<T, DatabaseStageEntry<T>> {
|
|
|
|
|
2021-09-01 00:01:56 +02:00
|
|
|
private final Serializer<T> serializer;
|
2021-01-31 19:52:47 +01:00
|
|
|
|
2021-09-01 00:01:56 +02:00
|
|
|
public SubStageGetterSingle(Serializer<T> serializer) {
|
2021-01-31 19:52:47 +01:00
|
|
|
this.serializer = serializer;
|
|
|
|
}
|
2021-01-31 00:36:21 +01:00
|
|
|
|
|
|
|
@Override
|
2023-02-09 23:34:25 +01:00
|
|
|
public DatabaseStageEntry<T> subStage(LLDictionary dictionary,
|
2021-01-31 00:36:21 +01:00
|
|
|
@Nullable CompositeSnapshot snapshot,
|
2023-02-09 23:34:25 +01:00
|
|
|
Buf keyPrefix) {
|
|
|
|
return new DatabaseMapSingle<>(dictionary, keyPrefix, serializer);
|
2021-01-31 19:52:47 +01:00
|
|
|
}
|
|
|
|
|
2021-01-31 00:36:21 +01:00
|
|
|
}
|