java.lang.Object
io.confluent.kafka.schemaregistry.rules.cel.builtin.CelDecimal
All Implemented Interfaces:
Comparable<CelDecimal>

public final class CelDecimal extends Object implements Comparable<CelDecimal>
The runtime Java representation of the CEL confluent.type.Decimal type (CelTypeLabels.DECIMAL): a BigDecimal whose equals is numeric.

Must not extend Number. cel-java's RuntimeEquality.objectEquals short-circuits on instanceof Number into ComparisonFunctions.numericEquals, which knows only Double / Long / UnsignedLong and answers false for any BigDecimal pair.

  • Method Details

    • of

      public static CelDecimal of(BigDecimal value)
    • ofUnscaled

      public static CelDecimal ofUnscaled(byte[] unscaled, int scale)
      From unscaled two's-complement big-endian bytes plus a scale — the encoding an Avro decimal logical type and a confluent.type.Decimal message both use.
    • value

      public BigDecimal value()
      The wrapped BigDecimal — the logical-type Java rep.
    • equals

      public boolean equals(Object o)
      Numeric, scale-insensitive — the same answer decimals.eq gives.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(CelDecimal other)
      Specified by:
      compareTo in interface Comparable<CelDecimal>
    • toString

      public String toString()
      Overrides:
      toString in class Object