Interface TranslationFailure
public interface TranslationFailure
Describes a failed localized string lookup.
Instances are supplied to a TranslationFailureHandler. Lokalized constructs these objects; application
code should normally only inspect them.
- Since:
- 3.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionGets the ordered locales actually attempted for this lookup.getCause()Gets the runtime cause if an attempted translation existed but could not be resolved.getKey()Gets the translation key that could not be resolved.default @NonNull Optional<@NonNull LocaleMatchResult> Gets strict locale-negotiation diagnostics when the implementation can provide them.Gets the locale used to begin per-key locale fallback after any language-range negotiation.Gets a concise description of this failure suitable for application logging.Gets the placeholders supplied by the caller.Gets the reason the lookup failed.
-
Method Details
-
getMessage
Gets a concise description of this failure suitable for application logging.The message includes the key, lookup locale, failure reason, and attempted locale tags. It does not inspect or include placeholder values or the runtime cause's message because either may contain sensitive data. The key is included verbatim and may itself contain placeholder names such as
{{name}}.- Returns:
- the redacted failure message, not null
- Since:
- 3.0.0
-
getKey
-
getLookupLocale
Gets the locale used to begin per-key locale fallback after any language-range negotiation.- Returns:
- the lookup locale, not null
-
getLocaleMatchResult
Gets strict locale-negotiation diagnostics when the implementation can provide them.- Returns:
- locale-negotiation result, or empty when unavailable, not null
-
getAttemptedLocales
Gets the ordered locales actually attempted for this lookup.- Returns:
- the attempted locales, not null
-
getPlaceholders
Gets the placeholders supplied by the caller.The returned map is an unmodifiable shallow copy. Placeholder values may contain sensitive data;
getMessage()deliberately excludes them.- Returns:
- the supplied placeholders, not null
-
getReason
Gets the reason the lookup failed.- Returns:
- the reason, not null
-
getCause
-