public final class SbeUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NULL_STRING_VALUE |
| Modifier and Type | Method and Description |
|---|---|
static java.math.BigDecimal |
convertToBD(com.marketfactory.protocol.sbe4.DecimalQtyNULLDecoder decoder) |
static java.math.BigDecimal |
convertToBD(com.marketfactory.protocol.sbe4.PriceNULLDecoder decoder) |
static double |
convertToDouble(com.marketfactory.protocol.sbe4.DecimalQtyNULLDecoder decoder) |
static double |
convertToDouble(com.marketfactory.protocol.sbe4.PriceNULLDecoder decoder) |
static long |
convertToNanos(java.time.Clock clock) |
static void |
copy(com.marketfactory.protocol.sbe4.MessageHeaderDecoder messageHeaderDecoder,
java.nio.ByteBuffer destination)
Copies the messageDecoder bytes (not the header) into a destination buffer.
|
static org.agrona.DirectBuffer |
copy(com.marketfactory.protocol.sbe4.MessageHeaderDecoder messageHeaderDecoder,
org.agrona.sbe.DecoderFlyweight messageDecoder)
Copies the messageDecoder bytes (not the header) into a newly created DirectBuffer.
|
static void |
copyDecimalQty(com.marketfactory.protocol.sbe4.DecimalQtyNULLDecoder source,
com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder destination) |
static void |
copyPrice(com.marketfactory.protocol.sbe4.PriceNULLDecoder source,
com.marketfactory.protocol.sbe4.PriceNULLEncoder destination) |
static int |
getDaysSinceEpoch(java.time.LocalDate localDate) |
static <T> T |
getOr(T value,
T nullValue) |
static void |
populateDecimalQtyNullEncoder(com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder encoder,
java.math.BigDecimal quantity)
Populates the provided DecimalQtyNULLEncoder (mantissa and exponent) from the provided
BigDecimal quantity.
|
static void |
populateDecimalQtyNullEncoder(com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder encoder,
long mantissa,
int exponent) |
static void |
populateDecimalQtyNullEncoderWithNullValue(com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder encoder) |
static void |
populatePriceNullEncoder(com.marketfactory.protocol.sbe4.PriceNULLEncoder encoder,
java.math.BigDecimal price)
Populates the provided PriceNULLEncoder (mantissa and exponent) from the provided
BigDecimal price.
|
static void |
populatePriceNullEncoder(com.marketfactory.protocol.sbe4.PriceNULLEncoder encoder,
long mantissa,
int exponent) |
static void |
populatePriceNullEncoderWithNullValue(com.marketfactory.protocol.sbe4.PriceNULLEncoder encoder) |
public static <T> T getOr(T value,
T nullValue)
public static void populateDecimalQtyNullEncoder(com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder encoder,
long mantissa,
int exponent)
public static void populateDecimalQtyNullEncoderWithNullValue(com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder encoder)
public static void populatePriceNullEncoderWithNullValue(com.marketfactory.protocol.sbe4.PriceNULLEncoder encoder)
public static void populatePriceNullEncoder(com.marketfactory.protocol.sbe4.PriceNULLEncoder encoder,
long mantissa,
int exponent)
public static void populatePriceNullEncoder(com.marketfactory.protocol.sbe4.PriceNULLEncoder encoder,
java.math.BigDecimal price)
encoder - encoder to populateprice - used to populate the encoder parameter. Can be null.public static void populateDecimalQtyNullEncoder(com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder encoder,
java.math.BigDecimal quantity)
encoder - encoder to populatequantity - used to populate the encoder parameter. Can be null.public static void copyPrice(com.marketfactory.protocol.sbe4.PriceNULLDecoder source,
com.marketfactory.protocol.sbe4.PriceNULLEncoder destination)
public static void copyDecimalQty(com.marketfactory.protocol.sbe4.DecimalQtyNULLDecoder source,
com.marketfactory.protocol.sbe4.DecimalQtyNULLEncoder destination)
public static int getDaysSinceEpoch(java.time.LocalDate localDate)
public static double convertToDouble(com.marketfactory.protocol.sbe4.DecimalQtyNULLDecoder decoder)
public static java.math.BigDecimal convertToBD(com.marketfactory.protocol.sbe4.DecimalQtyNULLDecoder decoder)
public static double convertToDouble(com.marketfactory.protocol.sbe4.PriceNULLDecoder decoder)
public static java.math.BigDecimal convertToBD(com.marketfactory.protocol.sbe4.PriceNULLDecoder decoder)
public static long convertToNanos(java.time.Clock clock)
public static org.agrona.DirectBuffer copy(com.marketfactory.protocol.sbe4.MessageHeaderDecoder messageHeaderDecoder,
org.agrona.sbe.DecoderFlyweight messageDecoder)
MessageHeaderDecoder.messageLength())
IllegalArgumentException.messageHeaderDecoder - used to provide the number of bytes in the messageDecodermessageDecoder - source of the bytes to copy to the returned DirectBufferpublic static void copy(com.marketfactory.protocol.sbe4.MessageHeaderDecoder messageHeaderDecoder,
java.nio.ByteBuffer destination)
MessageHeaderDecoder.messageLength())
IllegalArgumentException.messageHeaderDecoder - used to provide the number of bytes indestination - bytebuffer to copy the message bytes to