Package io.debezium.data
Class VariableScaleDecimal
java.lang.Object
io.debezium.data.VariableScaleDecimal
An arbitrary precision decimal value with variable scale.
- Author:
- Jiri Pechanec
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
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 Details
-
LOGICAL_NAME
- See Also:
-
VALUE_FIELD
- See Also:
-
SCALE_FIELD
- See Also:
-
SCHEMA_VERSION
public static final int SCHEMA_VERSION- See Also:
-
ZERO
public static final org.apache.kafka.connect.data.Struct ZERO
-
-
Constructor Details
-
VariableScaleDecimal
public VariableScaleDecimal()
-
-
Method Details
-
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:
-
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:
-
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 valuedecimalValue
- 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 valuedecimalValue
- the value or the decimal- Returns:
- the encoded value
-
toLogical
Decodes the encoded value - seefromLogical(Schema, BigDecimal)
for encoding format- Parameters:
value
- the encoded value- Returns:
- the decoded value
-