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