Package tripleplay.syncdb
Class DBUtil
java.lang.Object
tripleplay.syncdb.DBUtil
SyncDB
related utility methods.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> List<E>
decodeList
(String data, Codec<E> codec) Decodes a list encoded viaencodeList(java.util.List<E>, tripleplay.syncdb.Codec<E>)
.static <E> Set<E>
Decodes a set encoded viaencodeSet(java.util.Set<E>, tripleplay.syncdb.Codec<E>)
.static <E> String
encodeList
(List<E> list, Codec<E> codec) Encodes the supplied list as a string, using the supplied codec for its elements.static <E> String
Encodes the supplied set as a string, using the supplied codec for its elements.static <K> String
Computes the storage (fully qualified) key for the supplied map key.static String
Extracts and returns the subdb prefix from the supplied fully-qualified key.static String
Computes the storage (fully qualified) key for the supplied subdb property key.
-
Field Details
-
MAP_KEY_SEP
The separator used in a map key. This character must not appear in a normal key.- See Also:
-
SUBDB_KEY_SEP
The separator used in a subdb key. This character may appear in a normal key, but if the client plans to manage subdb conflict resolution in the aggregate, it is best to avoid using this separator elsewhere.- See Also:
-
-
Constructor Details
-
DBUtil
public DBUtil()
-
-
Method Details
-
decodeSet
Decodes a set encoded viaencodeSet(java.util.Set<E>, tripleplay.syncdb.Codec<E>)
. -
encodeSet
Encodes the supplied set as a string, using the supplied codec for its elements. The encoded set uses\t
to separate; that character should not appear incodec
's output. -
decodeList
Decodes a list encoded viaencodeList(java.util.List<E>, tripleplay.syncdb.Codec<E>)
. -
encodeList
Encodes the supplied list as a string, using the supplied codec for its elements. The encoded list uses\t
to separate; that character should not appear incodec
's output. -
subDBKey
Computes the storage (fully qualified) key for the supplied subdb property key. -
subDB
Extracts and returns the subdb prefix from the supplied fully-qualified key. Returns null if the supplied key is not a subdb key. -
mapKey
Computes the storage (fully qualified) key for the supplied map key.
-