Class LocalisedCheckReport.LocalisedReportEntry

java.lang.Object
de.aristaflow.adept2.util.CheckReport.ReportEntry
de.aristaflow.adept2.model.common.LocalisedCheckReport.LocalisedReportEntry
All Implemented Interfaces:
Serializable
Enclosing class:
LocalisedCheckReport

public static class LocalisedCheckReport.LocalisedReportEntry extends CheckReport.ReportEntry
A report entry extension providing localised messages.
See Also:
  • Field Details

    • localisedMessage

      protected final Map<Locale,String> localisedMessage
      The localised message of this report entry.
  • Constructor Details

    • LocalisedReportEntry

      protected LocalisedReportEntry(int entryNumber, String checkID, CheckReport.ResultType reportEntryType, String defaultMessage, Map<Locale,String> localisedMessage, URI... affectedElements)
      Constructs the report entry with the designated parameters.
      Parameters:
      entryNumber - the number of this entry in the report
      checkID - the check which created the entry
      reportEntryType - the type of the entry
      defaultMessage - The default message used if no corresponding localisation is found.
      localisedMessage - The localised message for the corresponding locale. This should contain all preferred locales (or at least the corresponding fallbacks) of the check report.
      affectedElements - the process elements affected by this entry
  • Method Details

    • getAllMessages

      public Map<Locale,String> getAllMessages()
      Gets the localised message(s) for all (preferred) locales. This does not consider fallback locales. You should usually use getMessage(Locale) or getMessage(Collection).
      Returns:
      The localised message(s) for all (preferred) locales.
    • getMessage

      public String getMessage(Locale locale)
      Gets the localised message of the check report entry corresponding to the designated locale or one of its fallback.
      Parameters:
      locale - The locale for which to get the message of the check report entry.
      Returns:
      The localised message of the check report entry.
    • getMessage

      public String getMessage(Collection<Locale> locales)
      Gets the localised message of the check report entry corresponding to the designated locales preferring previous locales.
      Parameters:
      locales - The locales for which to get the message of the check report entry with the first locale having the highest priority and the last locale the least priority.
      Returns:
      The localised message of the check report entry.