ComparableAttribute and BasicAttribute are preferred #976
+197
−96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains updates to make
ComparableAttribute
andBasicAttribute
be preferred for the static metamodel overSortableAttribute
andAttribute
.Attribute
is now documented as the common supertype that all metamodel attribute interfaces inherit from.SortableAttribute
is discouraged for most usage.Spec and JavaDoc examples are updated to show ComparableAttribute and BasicAttribute instead.
Elsewhere in spec and JavaDoc, we now list the provided attribute subtypes, along with what they are for, further promoting the use of TextAttribute/ComparableAttribute/BasicAttribute.
As a second commit in this PR, I moved the new internal implementation classes out of the public package where they would be visible as part of the API (it was a mistake that we ever allowed others there, but it was too late in the release cycle to correct it) and put them as package protected under the interface so that they will not be externalized to the user. Instead, the proper way to obtain instances is with the *Attribute.of(name) method. See examples that were also updated. This is cleaner and avoids externalizing implementation, which not only avoids cluttering the API, but also preserves our flexibility in the future to make changes to those implementations that would otherwise be considered a breaking change. I would like to eventually deprecate the .impl package altogether, but I did not do that in this PR.