Package com.lokalized

Interface Strings

All Known Implementing Classes:
DefaultStrings

public interface Strings
Contract for localized string providers - given a key and placeholders, return a localized string.

Format is "You are missing {{requiredFieldCount}} required fields."

Author:
Mark Allen
  • Method Details

    • get

      @Nonnull String get(@Nonnull String key)
      Gets a localized string for the given key.

      If no localized string is available, the key is returned.

      Parameters:
      key - the localization key, not null
      Returns:
      a localized string for the key, not null
    • get

      @Nonnull String get(@Nonnull String key, @Nullable Locale locale)
      Gets a localized string for the given key.

      If no localized string is available, the key is returned.

      Parameters:
      key - the localization key, not null
      locale - the preferred locale for the string, may be null
      Returns:
      a localized string for the key, not null
    • get

      @Nonnull String get(@Nonnull String key, @Nullable Map<String,Object> placeholders)
      Gets a localized string for the given key.

      If no localized string is available, the key is returned.

      Parameters:
      key - the localization key, not null
      placeholders - the placeholders to insert into the string, may be null
      Returns:
      a localized string for the key, not null
    • get

      @Nonnull String get(@Nonnull String key, @Nullable Map<String,Object> placeholders, @Nullable Locale locale)
      Gets a localized string for the given key.

      If no localized string is available, the key is returned.

      Parameters:
      key - the localization key, not null
      placeholders - the placeholders to insert into the string, may be null
      locale - the preferred locale for the string, may be null
      Returns:
      a localized string for the key, not null