/** * Transforms the given {@link Map} to a list of {@link KeyValuePair}'s. * * @param <K> * The generic type of the key * @param <V> * The generic type of the value * @param map * the map * @return the new list with the {@link KeyValuePair}'s. */ public static <K, V> List<KeyValuePair<K, V>> toKeyValuePairs(final Map<K, V> map) { final List<KeyValuePair<K, V>> list = new ArrayList<>(); for (final Entry<K, V> entry : map.entrySet()) { list.add( KeyValuePair.<K, V> builder().key(entry.getKey()).value(entry.getValue()).build()); } return list; }
/** * Transforms the given {@link Properties} to a list of {@link KeyValuePair}'s. * * @param properties * the properties * @return the new list with the {@link KeyValuePair}'s. */ public static List<KeyValuePair<String, String>> toKeyValuePairs(final Properties properties) { final List<KeyValuePair<String, String>> list = new ArrayList<>(); for (final Entry<Object, Object> entry : properties.entrySet()) { list.add(KeyValuePair.<String, String> builder().key((String)entry.getKey()) .value((String)entry.getValue()).build()); } return list; }
/** * {@inheritDoc} */ @Override public Response getResponseString(String bundleappname, String baseName, String locale, String key) { final ResourcebundleService resourcebundleService = getDomainService(); final BundleApplication bundleApplication = getDomainService().find(bundleappname); final String result = resourcebundleService.getString(bundleApplication, baseName, locale, key); return Response.ok(KeyValuePair.builder().key(key).value(result).build()).build(); }
/** * {@inheritDoc} */ @Override public Response getString(String bundleappname, String baseName, String locale, String key, String[] params) { final ResourcebundleService resourcebundleService = getDomainService(); final BundleApplication bundleApplication = getDomainService().find(bundleappname); final String result = resourcebundleService.getString(bundleApplication, baseName, locale, key, params); return Response.ok(KeyValuePair.builder().key(key).value(result).build()).build(); }
/** * {@inheritDoc} */ @Override public Response getString(String bundleappname, String baseName, String locale, String key) { final ResourcebundleService resourcebundleService = getDomainService(); final BundleApplication bundleApplication = getDomainService().find(bundleappname); final String result = resourcebundleService.getString(bundleApplication, baseName, locale, key); return Response.ok(KeyValuePair.builder().key(key).value(result).build()).build(); }