@SuppressWarnings("unchecked") @Test public void testClone() { content.setDefaultLanguage(italian); content.setLanguageResolution(LanguageResolution.Default); LocalizableContent<String> americanEnglish = null; try { americanEnglish = (LocalizableContent<String>)content.clone(); } catch (CloneNotSupportedException e) { fail("Creating clone of localizable content failed"); return; } assertEquals(content.size(), americanEnglish.size()); assertEquals(content.getLanguage(), americanEnglish.getLanguage()); assertEquals(content.getOriginalLanguage(), americanEnglish.getOriginalLanguage()); assertEquals(content.getLanguageResolution(), americanEnglish.getLanguageResolution()); assertEquals(content.get(), americanEnglish.get()); assertEquals(content.get(english), americanEnglish.get(english)); assertEquals(content.get(french), americanEnglish.get(french)); assertEquals(content.get(italian), americanEnglish.get(italian)); }
@SuppressWarnings("unchecked") public Object clone() throws CloneNotSupportedException { LocalizableContent<T> c = (LocalizableContent<T>) super.clone(); c.behavior = behavior; c.currentLanguage = currentLanguage; c.defaultLanguage = defaultLanguage; c.originalLanguage = originalLanguage; c.languages = new HashSet<Language>(); c.languages.addAll(languages); c.content = new HashMap<Language, T>(); c.content.putAll(content); return c; }
LocalizableContent extends LocalizableObject implements LocalizationListener, Cloneable { @SuppressWarnings("unchecked") public Object clone() throws CloneNotSupportedException { LocalizableContent<T> c = (LocalizableContent<T>) super.clone(); c.behavior = behavior; c.currentLanguage = currentLanguage; c.defaultLanguage = defaultLanguage; c.originalLanguage = originalLanguage; c.languages = new HashSet<Language>(); c.languages.addAll(languages); c.content = new HashMap<Language, T>(); c.content.putAll(content); return c; } }
LocalizableContent extends LocalizableObject implements LocalizationListener, Cloneable { @SuppressWarnings("unchecked") public Object clone() throws CloneNotSupportedException { LocalizableContent<T> c = (LocalizableContent<T>) super.clone(); c.behavior = behavior; c.currentLanguage = currentLanguage; c.defaultLanguage = defaultLanguage; c.originalLanguage = originalLanguage; c.languages = new HashSet<Language>(); c.languages.addAll(languages); c.content = new HashMap<Language, T>(); c.content.putAll(content); return c; } LocalizableContent();  LocalizableContent(Language language);  LocalizableContent(LocalizableObject localizable); }
LocalizableContent extends LocalizableObject implements LocalizationListener, Cloneable { @SuppressWarnings("unchecked") public Object clone() throws CloneNotSupportedException { LocalizableContent<T> c = (LocalizableContent<T>) super.clone(); c.behavior = behavior; c.currentLanguage = currentLanguage; c.defaultLanguage = defaultLanguage; c.originalLanguage = originalLanguage; c.languages = new HashSet<Language>(); c.languages.addAll(languages); c.content = new HashMap<Language, T>(); c.content.putAll(content); return c; } LocalizableContent();  LocalizableContent(Language language);  LocalizableContent(LocalizableObject localizable); void clear(); boolean isEmpty(); int size(); Collection<T> values(); @Override void disableLanguage(Language language); T put(T content, Language language); T get(); T get(Language language); T get(Language language, boolean force); void switchedTo(Language language, Language requestedLanguage); @SuppressWarnings("unchecked") Object clone(); String toString(Language language, boolean force); }
LocalizableContent extends LocalizableObject implements LocalizationListener, Cloneable { @SuppressWarnings("unchecked") public Object clone() throws CloneNotSupportedException { LocalizableContent<T> c = (LocalizableContent<T>) super.clone(); c.behavior = behavior; c.currentLanguage = currentLanguage; c.defaultLanguage = defaultLanguage; c.originalLanguage = originalLanguage; c.languages = new HashSet<Language>(); c.languages.addAll(languages); c.content = new HashMap<Language, T>(); c.content.putAll(content); return c; } LocalizableContent();  LocalizableContent(Language language);  LocalizableContent(LocalizableObject localizable); void clear(); boolean isEmpty(); int size(); Collection<T> values(); @Override void disableLanguage(Language language); T put(T content, Language language); T get(); T get(Language language); T get(Language language, boolean force); void switchedTo(Language language, Language requestedLanguage); @SuppressWarnings("unchecked") Object clone(); String toString(Language language, boolean force);  }