http_rest_url_builder library
Classes
- CommonEntry
- The base implementation of UrlEntry class that represents the basic element of the URL, with the entry name and value . The entry could be a query (https://example.com?id=1) or a single part of the url (https://example.com/{userId}/profile). The prime examples of CommonEntry implementation are Query and Path classes.
- Path
- The implementation of CommonEntry which handles the "path" in the URL. For a given url https://example.com/{userId}/profile the {userId} is a path entry, with the name parameter equal to "userId" and eventually the name={userId} will be replaced with the value=15 by the PathEntryHandler, so we will end up with https://example.com/15/profile.
- PathEntryHandler
-
The UrlEntryHandler which will replace all the URL paths with the given structure {<path_name>}
with the appropriate values.
For a given url https://example.com/{userId}/profile the {userId} is a path entry,
with the
name
parameter equal to "userId" and eventually thename
={userId} will be replaced with thevalue
=15 by the PathEntryHandler, so we will end up with https://example.com/15/profile. - Query
- The implementation of CommonEntry which handles the "query" in the URL. The QueryEntryHandler will add given Query entries the the end of the URL in a given order.
- QueryEntryHandler
- The QueryEntryHandler will add given Query entries the the end of the URL in a given order.
- UrlBuilder
- This class is a helper for URL path manipulations. It provides a way to keep the base url, then add a request path to it and apply some query and path params to it. Here is the example usage of it.
- UrlEntry
- The base class which used by UrlEntryHandler to identify the entries in the url by the provided key.
-
UrlEntryHandler<
E extends UrlEntry> - The base class which finds the url entries in the given url by the UrlEntry.key and makes the appropriate modifications to the url, by returning the modified URL as a result of onHandle method.