Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The PropertyDescriptor.Builder supports providing a Class that is both an Enum and DescribedValue. This improves type safety, by avoiding the passing of sheer arbitrary String values.
I'd like to propose extensions to both the PropertyDescriptor.Builder class as well as the PropertyValue interface.
The PropertyDescriptor.Builder should allow not only a raw String to be provided as defaultValue(), but also provide an overload that instead accepts an DescribedValue.
public Builder defaultValue(final DescribedValue value)
This allows to replace
.allowableValues(Foo.class) .defaultValue(Foo.BAR.getValue())
with
.allowableValues(Foo.class) .defaultValue(Foo.BAR)
The PropertyValue should allow to receive the value as one of the Enum constants, similar to one of the existing as... methods.
<E extends Enum<E> & DescribedValue> E asAllowableValue(Class<E> clazz)
This way processor implementations rely on type-safe mappings of allowable values instead of matching on String values manually.
Attachments
Issue Links
1.
|
Update Zendesk Components using Current API Methods | Resolved | endzeit |
|
||||||||
2.
|
Update components in iceberg bundle using current API methods | Resolved | endzeit |
|
||||||||
3.
|
Update components in snowflake bundle using current API methods | Resolved | endzeit |
|
||||||||
4.
|
Refactor components in cipher bundle using current API methods | Resolved | endzeit |
|
||||||||
5.
|
Refactor components in kafka bundle using current API methods | Resolved | endzeit |
|
||||||||
6.
|
Refactor components in azure bundle using current API methods | Resolved | endzeit |
|
||||||||
7.
|
Refactor components in asana bundle using current API methods | Resolved | endzeit |
|
||||||||
8.
|
Refactor components in cdc bundle using current API methods | Resolved | endzeit |
|
||||||||
9.
|
Refactor components in compress bundle using current API methods | Resolved | endzeit |
|
||||||||
10.
|
Refactor components in elasticsearch bundle using current API methods | Resolved | endzeit |
|
||||||||
11.
|
Refactor components in standard-processors bundle using current API methods | Resolved | endzeit |
|