/** * Create a URI by substituting any template variables * for corresponding template values. * <p> * A URI template varibale without a value will be substituted by the * empty string. * * @param values the array of template values. The values will be * substituted in order of occurence of unique template variables. * @return the URI. */ public final String createURI(String... values) { return createURI(values, 0, values.length); }
/** * Create a URI by substituting any template variables * for corresponding template values. * <p> * A URI template varibale without a value will be substituted by the * empty string. * * @param values the array of template values. The values will be * substituted in order of occurence of unique template variables. * @return the URI. */ public final String createURI(String... values) { return createURI(values, 0, values.length); }
private static DestinationUrlGenerator getDefaultToUriGenerator(final UriTemplate to) { checkNotNull(to); return (request, variables) -> to.createURI(variables); }
/** * Construct a URI from the component parts each of which may contain * template variables. * <p> * A template values is an Object instance MUST support the toString() * method to convert the template value to a String instance. * * @param scheme the URI scheme component * @param userInfo the URI user info component * @param host the URI host component * @param port the URI port component * @param path the URI path component * @param query the URI query componnet * @param fragment the URI fragment component * @param values the template variable to value map * @param encode if true encode a template value according to the correspond * component type of the associated template variable, otherwise * contextually encode the template value * @return a URI */ public final static String createURI(final String scheme, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Map<String, ? extends Object> values, final boolean encode) { return createURI(scheme, null, userInfo, host, port, path, query, fragment, values, encode); }
/** * Construct a URI from the component parts each of which may contain * template variables. * <p> * A template values is an Object instance MUST support the toString() * method to convert the template value to a String instance. * * @param scheme the URI scheme component * @param userInfo the URI user info component * @param host the URI host component * @param port the URI port component * @param path the URI path component * @param query the URI query componnet * @param fragment the URI fragment component * @param values the template variable to value map * @param encode if true encode a template value according to the correspond * component type of the associated template variable, otherwise * contextually encode the template value * @return a URI */ public final static String createURI(final String scheme, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Map<String, ? extends Object> values, final boolean encode) { return createURI(scheme, null, userInfo, host, port, path, query, fragment, values, encode); }
/** * Construct a URI from the component parts each of which may contain * template variables. * <p> * The template values are an array of Object and each Object instance * MUST support the toString() method to convert the template value to * a String instance. * * @param scheme the URI scheme component * @param userInfo the URI user info component * @param host the URI host component * @param port the URI port component * @param path the URI path component * @param query the URI query componnet * @param fragment the URI fragment component * @param values the array of template values * @param encode if true encode a template value according to the correspond * component type of the associated template variable, otherwise * contextually encode the template value * @return a URI */ public final static String createURI(final String scheme, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Object[] values, final boolean encode) { return createURI(scheme, null, userInfo, host, port, path, query, fragment, values, encode); }
/** * Construct a URI from the component parts each of which may contain * template variables. * <p> * The template values are an array of Object and each Object instance * MUST support the toString() method to convert the template value to * a String instance. * * @param scheme the URI scheme component * @param userInfo the URI user info component * @param host the URI host component * @param port the URI port component * @param path the URI path component * @param query the URI query componnet * @param fragment the URI fragment component * @param values the array of template values * @param encode if true encode a template value according to the correspond * component type of the associated template variable, otherwise * contextually encode the template value * @return a URI */ public final static String createURI(final String scheme, final String userInfo, final String host, final String port, final String path, final String query, final String fragment, final Object[] values, final boolean encode) { return createURI(scheme, null, userInfo, host, port, path, query, fragment, values, encode); }
private URI _buildFromMap(boolean encode, Map<String, ? extends Object> values) { if (ssp != null) { throw new IllegalArgumentException("Schema specific part is opaque"); } encodeMatrix(); encodeQuery(); String uri = UriTemplate.createURI( scheme, authority, userInfo, host, (port != -1) ? String.valueOf(port) : null, path.toString(), query.toString(), fragment, values, encode); return createURI(uri); }
private URI _buildFromMap(boolean encode, Map<String, ? extends Object> values) { if (ssp != null) { throw new IllegalArgumentException("Schema specific part is opaque"); } encodeMatrix(); encodeQuery(); String uri = UriTemplate.createURI( scheme, authority, userInfo, host, (port != -1) ? String.valueOf(port) : null, path.toString(), query.toString(), fragment, values, encode); return createURI(uri); }
private URI _build(boolean encode, Object... values) { if (values == null || values.length == 0) { return createURI(create()); } if (ssp != null) { throw new IllegalArgumentException("Schema specific part is opaque"); } encodeMatrix(); encodeQuery(); String uri = UriTemplate.createURI( scheme, authority, userInfo, host, (port != -1) ? String.valueOf(port) : null, path.toString(), query.toString(), fragment, values, encode); return createURI(uri); }
private URI _build(boolean encode, Object... values) { if (values == null || values.length == 0) { return createURI(create()); } if (ssp != null) { throw new IllegalArgumentException("Schema specific part is opaque"); } encodeMatrix(); encodeQuery(); String uri = UriTemplate.createURI( scheme, authority, userInfo, host, (port != -1) ? String.valueOf(port) : null, path.toString(), query.toString(), fragment, values, encode); return createURI(uri); }