@Test public void testJsonDeserializationToBasicTypes() { final Locale en_US = Locale.fromJavaLocale(java.util.Locale.US); final Locale he_IL = Locale.fromJavaLocale(new java.util.Locale("he", "IL")); final Map<Locale, String> localized = new LinkedHashMap<>(); localized.put(en_US, "English string with special characters: \"{},\\"); localized.put(he_IL, "מחרוזת בעברית"); final LocalizedString lstr = new LocalizedString(localized); final String json = Json.stringify(lstr); final Map<String, String> parsed = Json.parse(json, new TypeReference<Map<String, String>>() {}); assertEquals(2, parsed.size()); assertEquals(parsed.get("en_US"), localized.get(en_US)); assertEquals(parsed.get("he_IL"), localized.get(he_IL)); }
public String get(Locale locale) { return localized.get(locale); }
LocalizedString implements Serializable, Cloneable { public String get(Locale locale) { return localized.get(locale); } }
LocalizedString implements Serializable, Cloneable { public String get(Locale locale) { return localized.get(locale); } LocalizedString(Map<Locale, String> localized);  LocalizedString(); }
LocalizedString implements Serializable, Cloneable { public String get(Locale locale) { return localized.get(locale); } LocalizedString(Map<Locale, String> localized);  LocalizedString(); String get(Locale locale); Map<Locale, String> getLocalized(); @Override LocalizedString clone(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
LocalizedString implements Serializable, Cloneable { public String get(Locale locale) { return localized.get(locale); } LocalizedString(Map<Locale, String> localized);  LocalizedString(); String get(Locale locale); Map<Locale, String> getLocalized(); @Override LocalizedString clone(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final LocalizedString empty; }