Class Translation

  • All Implemented Interfaces:
    java.io.Serializable

    public class Translation
    extends java.lang.Object
    implements java.io.Serializable
    List of translations for a identifier.

    Exposes a fluid interface.

    See Also:
    Serialized Form
    • Constructor Detail

      • Translation

        public Translation()
      • Translation

        public Translation​(java.lang.String identifier,
                           java.util.List<Translation.Entry> entries)
    • Method Detail

      • getIdentifier

        public java.lang.String getIdentifier()
        Get the identifier for the translations.
        Returns:
        identifier of the translation
      • setIdentifier

        public Translation setIdentifier​(java.lang.String identifier)
        Set the identifier for the translations.
        Parameters:
        identifier - new identifier for the translation
        Returns:
        Translation for chaining.
      • getEntries

        public java.util.List<Translation.Entry> getEntries()
        Get all localized values for the identifier.
        Returns:
        localized values for the identifier
      • setEntries

        public Translation setEntries​(java.util.List<Translation.Entry> entries)
        Set the localized values for the identifier.
        Parameters:
        entries - localized entries for this translation
        Returns:
        Translation for chaining.
      • addEntry

        public Translation addEntry​(@NotNull
                                    @NotNull Translation.Entry entry)
        Add a translation entry for the identifier.
        Parameters:
        entry - new localized entry for this translation
        Returns:
        Translation for chaining.
      • addEntry

        public Translation addEntry​(java.lang.String lang,
                                    java.lang.String value)
        Add a translation entry for the identifier.
        Parameters:
        lang - language code
        value - value of translation * @return Translation for chaining.
      • localized

        public Translation localized​(java.lang.String languageCode)
      • getValue

        public java.lang.String getValue()
      • getValue

        public java.lang.String getValue​(java.lang.String languageCode)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object