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

support for embedding HAL resources. serialization only. #428

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trombka
Copy link

@trombka trombka commented Jan 22, 2016

See #270 and #36

@odrotbohm odrotbohm force-pushed the master branch 2 times, most recently from 4ebc1be to 266ad50 Compare July 25, 2016 18:32
Assert.notNull(links, "Given links must not be null!");
for (Link candidate : links) {
add(candidate);
public void add(Iterable linksOrEmdeddedResource) {

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?

Copy link
Author

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.

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.

@pivotal-issuemaster
Copy link

@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.

@gregturn
Copy link
Contributor

gregturn commented Mar 8, 2019

See #270 (comment) and #175 (comment) for examples of a fluent API I'm working on to simplify building RepresentationModel objects.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants