/** * Create a list from values. * * @param values values to create a list from. * @return list with values. */ public static <T> List<T> li(T... values) { return list(values); }
/** * Add multiple values in a classical JavaLite style. * * @param namesAndValues names and values (must pass even number). */ public static void put(String... namesAndValues) { contextTL.get().putAll(map(namesAndValues)); }
public Map<String, Object> toMap() { return map(CLASS, getClass().getName(), SOURCE, source.getName(), TARGET, target.getName()); }
/** * Provide names of headers to log to the log system with each request. * This configuration is dynamic and can be changed during runtime. * * @param headerNames list of headers to log. If the first argument is '*', all headers will be logged. */ public static void logHeaders(String... headerNames) { logHeaders = list(headerNames); }
protected String toJSON() { List models = new ArrayList(); metaModelsByTableName.values().forEach(metaModel -> { List associations = new ArrayList(); metaModel.getAssociations().forEach(association -> associations.add(association.toMap())); models.add(map( MODEL_CLASS, metaModel.getModelClass().getName(), DB_TYPE, metaModel.getDbType(), DB_NAME, metaModel.getDbName(), COLUMN_METADATA, metaModel.getColumnMetadata(), ASSOCIATIONS, associations )); }); return JsonHelper.toJsonString(models,false); }
/** * Create a list from values. * * @param values values to create a list from. * @return list with values. */ public static <T> List<T> li(T... values) { return list(values); }
((Map) metaModelMap.getOrDefault(COLUMN_METADATA, map())).forEach((column, map) -> { Map metadata = (Map) map; columnMetadataMap.put(
@Override public List<String> getEnds() { return list("</#if>"); }
/** * Add multiple values in a classical JavaLite style. * * @param namesAndValues names and values (must pass even number). */ public static void put(String... namesAndValues) { contextTL.get().putAll(map(namesAndValues)); }
/** * Create a list from values. * * @param values values to create a list from. * @return list with values. */ public static <T> List<T> li(T... values) { return list(values); }
/** * Convenience method for {@link #redirect(Class, java.util.Map)}. * * @param controllerClass controller class where to send redirect. * @param action action to redirect to. * @param id id to redirect to. * @return {@link HttpSupport.HttpBuilder}, to accept additional information. */ protected <T extends AppController> HttpBuilder redirect(Class<T> controllerClass, String action, Object id){ return redirect(controllerClass, map("action", action, "id", id)); }
@Override public List<String> getEnds() { return list("}"); }
/** * Convenience method for {@link #redirect(Class, java.util.Map)}. * * @param controllerClass controller class where to send redirect. * @param id id to redirect to. * @return {@link HttpSupport.HttpBuilder}, to accept additional information. */ protected <T extends AppController> HttpBuilder redirect(Class<T> controllerClass, Object id){ return redirect(controllerClass, map("id", id)); }
@Override public List<String> getEnds() { return list("</#list>"); }
/** * Convenience method to pass multiple names and corresponding values to a view. * * @param values - pairs of names and values. such as: name1, value1, name2, value2, etc. Number of arguments must be even. */ protected void view(Object ... values){ view(map(values)); }
public List<String> getEnds() { return list("</@" + tagName + ">", "/>"); }
/** * Renders a template by name. * * @param templateName name of template to render * @param namesAndValues - list of names and values, where first, third, etc argument is a name and second, * fourth, etc. argument is a corresponding value. * @return rendered template content as string */ protected String render(String templateName, String ... namesAndValues) { return render(templateName, map(namesAndValues)); }
/** * @param interfaceClass class of an interface for Guice injector */ public DynamicBuilder bind(Class interfaceClass){ pairs.add(list(interfaceClass)); return this; }
/** * Flash method to display multiple flash messages. * Takes in a vararg of values for flash. Number of arguments must be even. * Format: name, value, name, value, etc. * * @see #flash(String, Object) * @param values values to flash. */ protected void flash(Object ... values){ flash(map(values)); }
void setIncludedActions(String[] includedActions) { wildcard = false; this.includedActions.addAll(Collections.list(includedActions)); }