/** * This method instantiates the input uri template by arguments * <p> * <p> * <p> * Example: * <p> * <p> * {@code URITemplates.format("http://example.org/{}/{}", "A", 1)} results {@code "http://example.org/A/1" } * * @param uriTemplate String with placeholder * @param args args * @return a formatted string */ public static String format(String uriTemplate, Object... args) { return format(uriTemplate, Arrays.asList(args)); }
/** * This method instantiates the input uri template by arguments * <p> * <p> * <p> * Example: * <p> * <p> * {@code URITemplates.format("http://example.org/{}/{}", "A", 1)} results {@code "http://example.org/A/1" } * * @param uriTemplate String with placeholder * @param args args * @return a formatted string */ public static String format(String uriTemplate, Object... args) { return format(uriTemplate, Arrays.asList(args)); }
/** * This method instantiates the input uri template by arguments * <p> * <p> * <p> * Example: * <p> * <p> * {@code URITemplates.format("http://example.org/{}/{}", "A", 1)} results {@code "http://example.org/A/1" } * * @param uriTemplate String with placeholder * @param args args * @return a formatted string */ public static String format(String uriTemplate, Object... args) { return format(uriTemplate, Arrays.asList(args)); }
private static String getPredicateName(ImmutableTerm templateTerm, List<String> values) { if (templateTerm instanceof Variable) { return values.get(0); } else { String uriTemplate = ((ValueConstant) templateTerm).getValue(); return URITemplates.format(uriTemplate, values); } } }
private static String getPredicateName(Term templateTerm, List<String> values) { if (templateTerm instanceof Variable) { return values.get(0); } else { String uriTemplate = ((ValueConstant) templateTerm).getValue(); return URITemplates.format(uriTemplate, values); } } }
String uriTemplate = ((ValueConstant) uriTermForPredicateTerm).getValue(); predName = URITemplates.format(uriTemplate, values);