Package net.morimekta.providence.storage
Interface MessageStore<K,M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField>
-
- All Superinterfaces:
MessageReadOnlyStore<K,M,F>
,ReadOnlyStore<K,M>
,ReadWriteStore<K,M>
- All Known Implementing Classes:
DirectoryMessageStore
,InMemoryMessageStore
public interface MessageStore<K,M extends net.morimekta.providence.PMessage<M,F>,F extends net.morimekta.providence.descriptor.PField> extends MessageReadOnlyStore<K,M,F>, ReadWriteStore<K,M>
Interface for storing messages of a single type.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <B extends net.morimekta.providence.PMessageBuilder<M,F>>
java.util.Map<K,B>putAllBuilders(java.util.Map<K,B> builders)
Put a collection of key and builder pairs onto the store.default <B extends net.morimekta.providence.PMessageBuilder<M,F>>
BputBuilder(K key, B builder)
Put the message represented by the builder into the store on the given key.-
Methods inherited from interface net.morimekta.providence.storage.MessageReadOnlyStore
getAllBuilders, getBuilder
-
Methods inherited from interface net.morimekta.providence.storage.ReadOnlyStore
containsKey, get, getAll, keys, size
-
Methods inherited from interface net.morimekta.providence.storage.ReadWriteStore
put, putAll, remove, removeAll
-
-
-
-
Method Detail
-
putBuilder
@Nullable default <B extends net.morimekta.providence.PMessageBuilder<M,F>> B putBuilder(@Nonnull K key, @Nonnull B builder)
Put the message represented by the builder into the store on the given key. Any further modifications to the builder will not be reflected on the store.- Type Parameters:
B
- The builder type.- Parameters:
key
- The key to store the builder on.builder
- The builder to store.- Returns:
- The replaced builder if one was replaced. Null if the entry was created. Any modifications to the returned builder will not be reflected onto the store.
-
putAllBuilders
@Nonnull default <B extends net.morimekta.providence.PMessageBuilder<M,F>> java.util.Map<K,B> putAllBuilders(@Nonnull java.util.Map<K,B> builders)
Put a collection of key and builder pairs onto the store. Any further modifications to the builders will not be reflected onto the store.- Type Parameters:
B
- The builder type.- Parameters:
builders
- Map of builders to put into the store.- Returns:
- Map of replaced entries. Any modifications to the returned builders will not be reflected onto the store.
-
-