You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add configurable factory API to create Decimal32/64/128 instead of having to rely on static methods on individual types.
Currently, when you want to create a decimal, you need to call the right static method on the specific class you want to create, and if you want different overflow handling, you need to call yet another method. Having a configurable factory can simplify code where depending on some external input, conditions or configuration, different types need to be produced.
It would be helpful to be able to configure a factory/builder with the desired type and overflow handling, which would produce the right type from byte[], BigDecimal or BigInteger (valueOf and valueOfExact equivalents). This should be separate from the DecimalFactory interface used internally.
Beyond its configuration, this factory should be stateless and thread-safe.
The text was updated successfully, but these errors were encountered:
Add configurable factory API to create Decimal32/64/128 instead of having to rely on static methods on individual types.
Currently, when you want to create a decimal, you need to call the right static method on the specific class you want to create, and if you want different overflow handling, you need to call yet another method. Having a configurable factory can simplify code where depending on some external input, conditions or configuration, different types need to be produced.
It would be helpful to be able to configure a factory/builder with the desired type and overflow handling, which would produce the right type from
byte[]
,BigDecimal
orBigInteger
(valueOf
andvalueOfExact
equivalents). This should be separate from theDecimalFactory
interface used internally.Beyond its configuration, this factory should be stateless and thread-safe.
The text was updated successfully, but these errors were encountered: