With data-client added as library module (#3656)

* With data-client added as library module

* Fix build
This commit is contained in:
Vivek Maskara 2020-04-15 03:00:13 -07:00 committed by GitHub
parent 9ee04f3df4
commit 32ee0b4f9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
258 changed files with 34820 additions and 2 deletions

View 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}}() { }
}