/** * Expands the template using given parameters * * @param parameters * for expansion, must not be empty * @return expanded template */ public PartialUriTemplateComponents expand(Map<String, ?> parameters) { return getUriTemplateComponents(parameters, Collections.<String>emptyList()); }
/** * Expands the template using given parameters * * @param parameters * for expansion, must not be empty * @return expanded template */ public PartialUriTemplateComponents expand(Map<String, ?> parameters) { return getUriTemplateComponents(parameters, Collections.<String>emptyList()); }
/** * Returns the template as uri components, without variable expansion. * * @return components of the Uri */ public PartialUriTemplateComponents asComponents() { return getUriTemplateComponents(Collections.<String, Object>emptyMap(), Collections.<String>emptyList()); }
/** * Returns the template as uri components, without variable expansion. * * @return components of the Uri */ public PartialUriTemplateComponents asComponents() { return getUriTemplateComponents(Collections.<String, Object>emptyMap(), Collections.<String>emptyList()); }
/** * Strips all variables which are not required by any of the given action descriptors. If no action descriptors are * given, nothing will be stripped. * * @param actionDescriptors * to decide which variables are optional, may be empty * @return partial uri template components without optional variables, if actionDescriptors was not empty */ public PartialUriTemplateComponents stripOptionalVariables(List<ActionDescriptor> actionDescriptors) { return getUriTemplateComponents(Collections.<String, Object>emptyMap(), getRequiredArgNames(actionDescriptors)); }
/** * Strips all variables which are not required by any of the given action descriptors. If no action descriptors are * given, nothing will be stripped. * * @param actionDescriptors * to decide which variables are optional, may be empty * @return partial uri template components without optional variables, if actionDescriptors was not empty */ public PartialUriTemplateComponents stripOptionalVariables(List<ActionDescriptor> actionDescriptors) { return getUriTemplateComponents(Collections.<String, Object>emptyMap(), getRequiredArgNames(actionDescriptors)); }
/** * Expands the template using given parameters * * @param parameters * for expansion in the order of appearance in the template, must not be empty * @return expanded template */ public PartialUriTemplateComponents expand(Object... parameters) { List<String> variableNames = getVariableNames(); Map<String, Object> parameterMap = new LinkedHashMap<String, Object>(); int i = 0; for (String variableName : variableNames) { if (i < parameters.length) { parameterMap.put(variableName, parameters[i++]); } else { break; } } return getUriTemplateComponents(parameterMap, Collections.<String>emptyList()); }
/** * Expands the template using given parameters * * @param parameters * for expansion in the order of appearance in the template, must not be empty * @return expanded template */ public PartialUriTemplateComponents expand(Object... parameters) { List<String> variableNames = getVariableNames(); Map<String, Object> parameterMap = new LinkedHashMap<String, Object>(); int i = 0; for (String variableName : variableNames) { if (i < parameters.length) { parameterMap.put(variableName, parameters[i++]); } else { break; } } return getUriTemplateComponents(parameterMap, Collections.<String>emptyList()); }