Package org.infinispan.counter.util
Class EncodeUtil
java.lang.Object
org.infinispan.counter.util.EncodeUtil
Utility class to handle encoding or decoding counter's classes.
- Since:
- 9.2
- Author:
- Pedro Ruivo
-
Method Summary
Modifier and TypeMethodDescriptionstatic CounterConfiguration
decodeConfiguration
(Supplier<Byte> byteSupplier, LongSupplier longSupplier, IntSupplier intSupplier) static Storage
decodeStorage
(byte flags) Decodes theCounterType
.static CounterType
decodeType
(byte flags) Decodes theStorage
.static void
encodeConfiguration
(CounterConfiguration configuration, Consumer<Byte> byteConsumer, LongConsumer longConsumer, IntConsumer intConsumer) Encodes the configuration.static byte
encodeTypeAndStorage
(CounterConfiguration configuration) Encodes theStorage
and theCounterType
.
-
Method Details
-
decodeStorage
Decodes theCounterType
.- Returns:
- the decoded
CounterType
. - See Also:
-
decodeType
Decodes theStorage
.- Returns:
- the decoded
Storage
. - See Also:
-
encodeTypeAndStorage
Encodes theStorage
and theCounterType
.See the documentation for further details about the encoding.
- Returns:
- the encoded
Storage
and theCounterType
. - See Also:
-
encodeConfiguration
public static void encodeConfiguration(CounterConfiguration configuration, Consumer<Byte> byteConsumer, LongConsumer longConsumer, IntConsumer intConsumer) Encodes the configuration.See the documentation for further details about the encoding.
- See Also:
-
decodeConfiguration
public static CounterConfiguration decodeConfiguration(Supplier<Byte> byteSupplier, LongSupplier longSupplier, IntSupplier intSupplier) Decodes aCounterConfiguration
encoded byencodeConfiguration(CounterConfiguration, Consumer, LongConsumer, IntConsumer)
.- Returns:
- the decoded
CounterConfiguration
. - See Also:
-