Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise PropertyBuilder methods for default values #128

Closed
ljacqu opened this issue Apr 5, 2020 · 1 comment
Closed

Revise PropertyBuilder methods for default values #128

ljacqu opened this issue Apr 5, 2020 · 1 comment
Milestone

Comments

@ljacqu
Copy link
Member

ljacqu commented Apr 5, 2020

The defaultEntry method on MapPropertyBuilder should be renamed to make a clearer distinction between it and PropertyBuilder#defaultValue. The former amends values to a default while the former overwrites any previous values.

  • PropertyBuilder#defaultValue sets the default value (overwrites)
  • MapPropertyBuilder#defaultEntry puts to the existing map it keeps

Additionally, it would be nice to have a method like addToDefaultValue for builders that create a property of Collection type (SetPropertyBuilder, ListPropertyBuilder)

@ljacqu ljacqu added this to the ConfigMe 2.0.0 milestone Nov 22, 2020
@ljacqu ljacqu self-assigned this Aug 29, 2023
ljacqu added a commit that referenced this issue Sep 12, 2023
…perty builders

- Arrays, inline arrays and collections are now based on property types which can be constructed from other property paths
- Introduce an enum set type
- Refactor the property builders (remove inheritance among builders, rename methods for default values to be more clear)
- Lift requirement that the collections in properties are always unmodifiable; to be seen in more depth with #379
ljacqu added a commit that referenced this issue Sep 15, 2023
@ljacqu
Copy link
Member Author

ljacqu commented Sep 20, 2023

New structure for property builders:

  • The method defaultValue sets the entire default value for a property; it may only be called once, and not in combination with other methods that modify the default value.
  • Property builders for collections, maps and arrays have another method addToDefaultValue that allows to define one entry of the default value. This method can be called repeatedly.

@ljacqu ljacqu closed this as completed Sep 20, 2023
@ljacqu ljacqu removed their assignment Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant