mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
With data-client added as library module (#3656)
* With data-client added as library module * Fix build
This commit is contained in:
parent
9ee04f3df4
commit
32ee0b4f9a
258 changed files with 34820 additions and 2 deletions
36
data-client/scripts/templates/basichash.java.jinja
Normal file
36
data-client/scripts/templates/basichash.java.jinja
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
This file is auto-generated from a template (/scripts/templates).
|
||||
If you need to modify it, make sure to modify the template, not this file.
|
||||
*/
|
||||
package org.wikipedia.staticdata;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public final class {{class_name}} {
|
||||
@NonNull private static final Map<String, String> DATA_MAP = Collections.unmodifiableMap(newMap());
|
||||
|
||||
@NonNull public static String valueFor(String key) {
|
||||
if (DATA_MAP.containsKey(key)) {
|
||||
return DATA_MAP.get(key);
|
||||
}
|
||||
return DATA_MAP.get("en");
|
||||
}
|
||||
|
||||
@SuppressWarnings({"checkstyle:methodlength", "SpellCheckingInspection"})
|
||||
private static Map<String, String> newMap() {
|
||||
final int size = {{wikis|length}};
|
||||
Map<String, String> map = new HashMap<>(size);
|
||||
|
||||
{%- for wiki in wikis %}
|
||||
map.put("{{wiki.lang}}", "{{wiki.props[key]}}");
|
||||
{%- endfor %}
|
||||
return map;
|
||||
}
|
||||
|
||||
private {{class_name}}() { }
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue