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

Let nullable ScoredValue factory methods return Value<V> instead of ScoredValue<V> #1644

Closed
mp911de opened this issue Mar 4, 2021 · 0 comments
Labels
type: breaking Breaking change type: task A general task
Milestone

Comments

@mp911de
Copy link
Collaborator

mp911de commented Mar 4, 2021

Having an empty ScoredValue doesn't make sense as it cannot be persisted nor it makes sense to construct it by a user as the scored value is always associated with a score. Instead, an empty ScoredValue should just return an empty value.

In that scope, we should revisit the nullable factory methods of GeoValue, whether a nullable GeoValue.fromNullable should be introduced with a return type of Value<V> to indicate it can be either a present GeoValue<V> or an absent Value<V>.

@mp911de mp911de added the type: task A general task label Mar 4, 2021
@mp911de mp911de changed the title Deprecate nullable ScoredValue factory methods Let nullable ScoredValue factory methods return Value<V> instead of ScoredValue<V> Mar 5, 2021
@mp911de mp911de added this to the 6.1 RC1 milestone Mar 5, 2021
@mp911de mp911de added the type: breaking Breaking change label Mar 5, 2021
mp911de added a commit that referenced this issue Mar 5, 2021
GeoValue provides now from and fromNullable methods returning Value. Empty values should not be associated with coordinates.

Value now exposes isEmpty() and ifHasValueOrElse(…) methods to improve functional programming arrangements.
mp911de added a commit that referenced this issue Mar 5, 2021
…coredValue<V> #1644

Nullable ScoredValue factory methods now declare Value as return type as an empty value cannot be associated without a score. Either both pieces of information should be present or absent but partial existence doesn't fit the programming model.
@mp911de mp911de closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: breaking Breaking change type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant