Class MultilingualString

java.lang.Object
org.ametys.plugins.repository.metadata.MultilingualString

public class MultilingualString extends Object
Class representing a multilingual String
  • Constructor Details

  • Method Details

    • add

      public void add(Locale locale, String value)
      Add or replace value for a specific locale.
      Parameters:
      locale - The locale. Can not be null.
      value - The value for this locale.
    • getValue

      public String getValue(Locale locale)
      Returns the value in the given locale as String.
      Parameters:
      locale - the locale of value to retrieve
      Returns:
      the value as String or null if not found
    • getLocales

      public Set<Locale> getLocales()
      Returns the existing Locales
      Returns:
      the locales
    • getValues

      public List<String> getValues()
      Get all non-empty values
      Returns:
      the values
    • hasLocale

      public boolean hasLocale(Locale locale)
      Determines if this multilingual string has value for the given locale
      Parameters:
      locale - The locale to test
      Returns:
      true if a value exists for this locale
      Throws:
      AmetysRepositoryException - if an error occurs.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object