Skip to content

Add configurable factory API to create Decimal32/64/128 instead of having to rely on static methods on individual types #6

@mrotteveel

Description

@mrotteveel

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions