Class MultiLanguageValue

java.lang.Object
io.goobi.viewer.model.translations.MultiLanguageValue
All Implemented Interfaces:
IPolyglott

public class MultiLanguageValue extends Object implements IPolyglott
Author:
florian
  • Constructor Details

  • Method Details

    • isComplete

      public boolean isComplete(Locale locale)
      Description copied from interface: IPolyglott
      If this returns true, an associated language tab should have the 'already-translated' class, otherwise the '-partly-translated' class unless IPolyglott.isEmpty(Locale) also returns true
      Specified by:
      isComplete in interface IPolyglott
      Returns:
      true if IPolyglott.isValid(Locale) returns true for the given locale and all fields contain a value which have a value in the default locale. For the default locale, IPolyglott.isComplete(Locale) and IPolyglott.isValid(Locale) are identical. For implementations with only one field, both methods are also always identical
    • isValid

      public boolean isValid(Locale locale)
      Description copied from interface: IPolyglott
      Only meaningfull for the default language for which all required fields must be filled
      Specified by:
      isValid in interface IPolyglott
      Returns:
      true if all required fields contain a value in the given locale
    • getSelectedLocale

      public Locale getSelectedLocale()
      Specified by:
      getSelectedLocale in interface IPolyglott
      Returns:
      the locale currently set by IPolyglott.setSelectedLocale(Locale)
    • setSelectedLocale

      public void setSelectedLocale(Locale locale)
      Description copied from interface: IPolyglott
      Set the locale to use for display and editing
      Specified by:
      setSelectedLocale in interface IPolyglott
    • getSelectedTranslation

      public Translation getSelectedTranslation()
      Returns:
      the translation for the selected locale. Create a new translation if none exists
    • getTranslation

      public Translation getTranslation(Locale locale)
      Parameters:
      locale -
      Returns:
      the translation for the given language if one exists
    • getLocales

      public Collection<Locale> getLocales()
      Description copied from interface: IPolyglott
      Get a list of all locales configured in the faces-configuration file.
      Specified by:
      getLocales in interface IPolyglott
      Returns:
      Collection
    • setValue

      public void setValue(String value)
    • getValue

      public String getValue()
    • setValueForLocale

      public void setValueForLocale(Locale locale, String value)
    • getValueForLocale

      public String getValueForLocale(Locale locale)
    • stream

      public Stream<Translation> stream()
    • map

      public Map<Locale,String> map()
    • hasLocale

      public boolean hasLocale(Locale locale)
      Parameters:
      locale -
      Returns:
      true if this list has an entry for the given locale
    • isEmpty

      public boolean isEmpty(Locale locale)
      Description copied from interface: IPolyglott
      If this returns true, an associated language tab should have neither the 'already-translated' nor the '-partly-translated' class
      Specified by:
      isEmpty in interface IPolyglott
      Returns:
      true if no fields are filled for the given locale