-
Notifications
You must be signed in to change notification settings - Fork 477
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
support for embedding HAL resources. serialization only. #428
base: main
Are you sure you want to change the base?
Conversation
4ebc1be
to
266ad50
Compare
Assert.notNull(links, "Given links must not be null!"); | ||
for (Link candidate : links) { | ||
add(candidate); | ||
public void add(Iterable linksOrEmdeddedResource) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a compelling reason to avoid strong typing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot have both add(Iterable) and add(Iterable) as explained here: http://stackoverflow.com/questions/1998544/method-has-the-same-erasure-as-another-method-in-type
Leaving all add
methods for Link
and having addEmbeddeResource
would kind of break a naming convention.
In my opinion it would be better to deprecate add
in favour of addLink(s)
and addEmbeddedResource(s)
. However this would be a change of a public interface of the class, so I thought it was not suitable for a simple PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO addEmbedded or addEmbeddedResource is a justified addition to the API.
@trombka Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
See #270 (comment) and #175 (comment) for examples of a fluent API I'm working on to simplify building NOTE: I still don't have a way to mix both top level data attributes AND embedded stuff, which is clearly denoted in the spec. That may require something more fundamental. |
2e02d7a
to
856b6b9
Compare
5828e78
to
e643c37
Compare
See #270 and #36