Package io.debezium.data
Class VariableScaleDecimal
- java.lang.Object
-
- io.debezium.data.VariableScaleDecimal
-
public class VariableScaleDecimal extends Object
An arbitrary precision decimal value with variable scale.- Author:
- Jiri Pechanec
-
-
Field Summary
Fields Modifier and Type Field Description static String
LOGICAL_NAME
static String
SCALE_FIELD
static String
VALUE_FIELD
static org.apache.kafka.connect.data.Struct
ZERO
-
Constructor Summary
Constructors Constructor Description VariableScaleDecimal()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.kafka.connect.data.SchemaBuilder
builder()
Returns aSchemaBuilder
for a VariableScaleDecimal.static org.apache.kafka.connect.data.Struct
fromLogical(org.apache.kafka.connect.data.Schema schema, SpecialValueDecimal value)
Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.static org.apache.kafka.connect.data.Struct
fromLogical(org.apache.kafka.connect.data.Schema schema, BigDecimal decimalValue)
Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.static org.apache.kafka.connect.data.Schema
optionalSchema()
Returns a Schema for an optional VariableScaleDecimal but with all other default Schema settings.static org.apache.kafka.connect.data.Schema
schema()
Returns a Schema for a VariableScaleDecimal but with all other default Schema settings.static SpecialValueDecimal
toLogical(org.apache.kafka.connect.data.Struct value)
Decodes the encoded value - seefromLogical(Schema, BigDecimal)
for encoding format
-
-
-
Field Detail
-
LOGICAL_NAME
public static final String LOGICAL_NAME
- See Also:
- Constant Field Values
-
VALUE_FIELD
public static final String VALUE_FIELD
- See Also:
- Constant Field Values
-
SCALE_FIELD
public static final String SCALE_FIELD
- See Also:
- Constant Field Values
-
ZERO
public static final org.apache.kafka.connect.data.Struct ZERO
-
-
Method Detail
-
builder
public static org.apache.kafka.connect.data.SchemaBuilder builder()
Returns aSchemaBuilder
for a VariableScaleDecimal. You can use the resulting SchemaBuilder to set additional schema settings such as required/optional, default value, and documentation.- Returns:
- the schema builder
-
schema
public static org.apache.kafka.connect.data.Schema schema()
Returns a Schema for a VariableScaleDecimal but with all other default Schema settings.- Returns:
- the schema
- See Also:
builder()
-
optionalSchema
public static org.apache.kafka.connect.data.Schema optionalSchema()
Returns a Schema for an optional VariableScaleDecimal but with all other default Schema settings.- Returns:
- the schema
- See Also:
builder()
-
fromLogical
public static org.apache.kafka.connect.data.Struct fromLogical(org.apache.kafka.connect.data.Schema schema, SpecialValueDecimal value)
Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.- Parameters:
schema
- of the encoded valuevalue
- the value or the decimal- Returns:
- the encoded value
-
fromLogical
public static org.apache.kafka.connect.data.Struct fromLogical(org.apache.kafka.connect.data.Schema schema, BigDecimal decimalValue)
Converts a value from its logical format to its encoded format - a struct containing the scale of the number and a binary representation of the number.- Parameters:
schema
- of the encoded valuevalue
- the value or the decimal- Returns:
- the encoded value
-
toLogical
public static SpecialValueDecimal toLogical(org.apache.kafka.connect.data.Struct value)
Decodes the encoded value - seefromLogical(Schema, BigDecimal)
for encoding format- Parameters:
value
- the encoded value- Returns:
- the decoded value
-
-