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

add overloaded URI, UriBuilder, etc. method methods #23

Open
garretwilson opened this issue Jan 11, 2015 · 3 comments
Open

add overloaded URI, UriBuilder, etc. method methods #23

garretwilson opened this issue Jan 11, 2015 · 3 comments

Comments

@garretwilson
Copy link

garretwilson commented Jan 11, 2015

This is a little thing but it sure would add to the convenience.

If I do a match(get(myURIString)), why can't I use a URI itself, as in match(get(myURI))? In fact, it would be nice to pass parameters. That way I could do this:

URI myURI=URI.create("foo/{bar}");
match(get(myURI, "example")) ...

This implementation of get() would be something like this:

public static ConditionWithApplicables get(final URI uri, Object... values) {
  return get(UriBuilder.fromUri(uri).build(values).toASCIIString());
}

The UriBuilder version might be something like this:

public static ConditionWithApplicables get(final UriBuilder uriBuilder, Object... values) {
  return get(uriBuilder.clone().build(values).toASCIIString());
}

Thanks for considering this.

@mkotsur mkotsur added this to the 0.5 milestone Jan 25, 2015
@mkotsur mkotsur removed this from the 0.5 milestone Sep 28, 2017
@mkotsur
Copy link
Owner

mkotsur commented Sep 28, 2017

And is this also still relevant? I guess it would make sense to pick them up all together :-)

@mkotsur
Copy link
Owner

mkotsur commented Oct 23, 2017

@garretwilson are you sure you need to have UriBuilder in the API? It also costs an extra dependency on jax-rs, which we don't use anywhere else...

I think we should absolutely support java.net.URI, but uriBuilder.clone().build(values).toASCIIString() should be happening in a helper method outside of the library, IMO.

/cc @kenny-brown

@garretwilson
Copy link
Author

It's been a few months since I looked at this, but I may not have realized that UriBuilder would add another dependency --- and you're right, we probably don't want to add another dependency. Although UriBuilder is part of Java EE. Maybe there could be an add-on library for UriBuilder matchers.

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

No branches or pull requests

2 participants